home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d16 / winapi.arc / WINAPI.TXT < prev   
Text File  |  1991-05-13  |  124KB  |  2,801 lines

  1. ' ------------------------------------------------------------------------
  2. '
  3. '     WINAPI.TXT -- Windows 3.0 API Declarations for Visual Basic
  4. '
  5. '              Copyright (C) 1991 Microsoft Corporation
  6. '
  7. '  You have a royalty-free right to use, modify, reproduce and distribute
  8. '  this file (and/or any modified version) in any way you find useful,
  9. '  provided that you agree that Microsoft has no warranty, obligation or
  10. '  liability for its contents.  Refer to the Microsoft Windows Programmer's
  11. '  Reference for further information.
  12. '
  13. ' ------------------------------------------------------------------------
  14.  
  15.  
  16. '   General Purpose Defines
  17.  
  18. Global Const NULL = 0
  19.  
  20. Type RECT
  21.     left As Integer
  22.     top As Integer
  23.     right As Integer
  24.     bottom As Integer
  25. End Type
  26.  
  27. Type POINTAPI
  28.     x As Integer
  29.     y As Integer
  30. End Type
  31.  
  32. ' --------------------------------------------------------------------------
  33. '   Kernel Section
  34. ' --------------------------------------------------------------------------
  35.  
  36.  
  37. ' ParameterBlock description structure for use with LoadModule
  38. Type PARAMETERBLOCK
  39.     wEnvSeg As Integer
  40.     lpCmdLine As Long
  41.     lpCmdShow As Long
  42.     dwReserved As Long
  43. End Type
  44.  
  45. '  Loader Routines
  46. Declare Function GetVersion Lib "Kernel" () As Integer
  47. Declare Function GetNumTasks Lib "Kernel" () As Integer
  48. Declare Function GetModuleHandle Lib "Kernel" (ByVal lpModuleName As String) As Integer
  49. Declare Function GetModuleUsage Lib "Kernel" (ByVal hModule As Integer) As Integer
  50. Declare Function GetModuleFileName Lib "Kernel" (ByVal hModule As Integer, ByVal lpFilename As String, ByVal nSize As Integer) As Integer
  51. Declare Function GetInstanceData Lib "Kernel" (ByVal hInstance As Integer, ByVal pData As Integer, ByVal nCount As Integer) As Integer
  52. Declare Function LoadLibrary Lib "Kernel" (ByVal lpLibFileName As String) As Integer
  53. Declare Function LoadModule Lib "Kernel" (ByVal lpModuleName As String, lpParameterBlock As PARAMETERBLOCK) As Integer
  54. Declare Sub FreeModule Lib "Kernel" (ByVal hModule As Integer) 
  55. Declare Sub FreeLibrary Lib "Kernel" (ByVal hLibModule As Integer)
  56. Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags As Integer) As Long
  57. Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, nCmdShow As Integer) As Integer
  58. Declare Sub DebugBreak Lib "Kernel" ()
  59. Declare Sub OutputDebugString Lib "Kernel" (ByVal lpOutputString As String)
  60. Declare Sub SwitchStackBack Lib "Kernel" ()
  61. Declare Sub SwitchStackTo Lib "Kernel" (ByVal wStackSegment As Integer, ByVal wStackPointer As Integer, ByVal wStackTop As Integer)
  62. Declare Function GetCurrentPDB Lib "Kernel" () As Integer
  63.  
  64.  
  65. '  OpenFile() Structure
  66. Type OFSTRUCT
  67.     cBytes As String * 1
  68.     fFixedDisk As String * 1
  69.     nErrCode As Integer
  70.     reserved As String * 4
  71.     szPathName As String * 128
  72. End Type
  73.  
  74. '  OpenFile() Flags
  75. Global Const OF_READ = &H0
  76. Global Const OF_WRITE = &H1
  77. Global Const OF_READWRITE = &H2
  78. Global Const OF_SHARE_COMPAT = &H0
  79. Global Const OF_SHARE_EXCLUSIVE = &H10
  80. Global Const OF_SHARE_DENY_WRITE = &H20
  81. Global Const OF_SHARE_DENY_READ = &H30
  82. Global Const OF_SHARE_DENY_NONE = &H40
  83. Global Const OF_PARSE = &H100
  84. Global Const OF_DELETE = &H200
  85. Global Const OF_VERIFY = &H400
  86. Global Const OF_CANCEL = &H800
  87. Global Const OF_CREATE = &H1000
  88. Global Const OF_PROMPT = &H2000
  89. Global Const OF_EXIST = &H4000
  90. Global Const OF_REOPEN = &H8000
  91.  
  92. Declare Function OpenFile Lib "Kernel" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Integer) As Integer
  93.  
  94. '  GetTempFileName() Flags
  95. '
  96. Global Const TF_FORCEDRIVE = &H80
  97.  
  98. Declare Function GetTempDrive Lib "Kernel" (ByVal cDriveLetter as Integer) As Integer
  99. Declare Function GetTempFileName Lib "Kernel" (ByVal cDriveLetter as Integer, ByVal lpPrefixString As String, ByVal wUnique As Integer, ByVal lpTempFileName As String) As Integer
  100. Declare Function SetHandleCount Lib "Kernel" (ByVal wNumber As Integer) As Integer
  101.  
  102. Declare Function GetDriveType Lib "Kernel" (ByVal nDrive As Integer) As Integer
  103.  
  104. '  GetDriveType return values
  105. Global Const DRIVE_REMOVABLE = 2
  106. Global Const DRIVE_FIXED = 3
  107. Global Const DRIVE_REMOTE = 4
  108.  
  109. '  Global Memory Flags
  110. Global Const GMEM_FIXED = &H0
  111. Global Const GMEM_MOVEABLE = &H2
  112. Global Const GMEM_NOCOMPACT = &H10
  113. Global Const GMEM_NODISCARD = &H20
  114. Global Const GMEM_ZEROINIT = &H40
  115. Global Const GMEM_MODIFY = &H80
  116. Global Const GMEM_DISCARDABLE = &H100
  117. Global Const GMEM_NOT_BANKED = &H1000
  118. Global Const GMEM_SHARE = &H2000
  119. Global Const GMEM_DDESHARE = &H2000
  120. Global Const GMEM_NOTIFY = &H4000
  121. Global Const GMEM_LOWER = GMEM_NOT_BANKED
  122.  
  123. Global Const GHND = (GMEM_MOVEABLE Or GMEM_ZEROINIT)
  124. Global Const GPTR = (GMEM_FIXED Or GMEM_ZEROINIT)
  125.  
  126. Declare Function GlobalAlloc Lib "Kernel" (ByVal wFlags As Integer, ByVal dwBytes As Long) As Integer
  127. Declare Function GlobalCompact Lib "Kernel" (ByVal dwMinFree As Long) As Long
  128. Declare Function GlobalFree Lib "Kernel" (ByVal hMem As Integer) As Integer
  129. Declare Function GlobalHandle Lib "Kernel" (ByVal wMem As Integer) As Long
  130. Declare Function GlobalLock Lib "Kernel" (ByVal hMem As Integer) As Long
  131. Declare Function GlobalReAlloc Lib "Kernel" (ByVal hMem As Integer, ByVal dwBytes As Long, ByVal wFlags As Integer) As Integer
  132.  
  133. 'NOTE: instead of declaring the function GlobalDiscard and calling 
  134. '      GlobalDiscard(hMem), call GlobalReAlloc(hMem, 0, GMEM_MOVEABLE)
  135.  
  136. Declare Function GlobalSize Lib "Kernel" (ByVal hMem As Integer) As Long
  137. Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem As Integer) As Integer
  138. Declare Function UnlockResource Lib "Kernel" Alias "GlobalUnlock" (ByVal hMem As Integer) As Integer
  139. Declare Function GlobalFlags Lib "Kernel" (ByVal hMem As Integer) As Integer
  140. Declare Function GlobalWire Lib "Kernel" (ByVal hMem As Integer) As Long
  141. Declare Function GlobalUnWire Lib "Kernel" (ByVal hMem As Integer) As Integer
  142. Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem As Integer) As Integer
  143. Declare Function GlobalLRUNewest Lib "Kernel" (ByVal hMem As Integer) As Integer
  144. Declare Function GlobalLRUOldest Lib "Kernel" (ByVal hMem As Integer) As Integer
  145. Declare Function GlobalPageLock Lib "Kernel" (ByVal wSelector As Integer) As Integer
  146. Declare Function GlobalPageUnlock Lib "Kernel" (ByVal wSelector As Integer) As Integer
  147. Declare Sub GlobalFix Lib "Kernel" (ByVal hMem As Integer)
  148. Declare Function GlobalUnfix Lib "Kernel" (ByVal hMem As Integer) As Integer
  149.  
  150. '  Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE)
  151. Global Const GMEM_DISCARDED = &H4000
  152. Global Const GMEM_LOCKCOUNT = &HFF
  153.  
  154. Declare Function LockSegment Lib "Kernel" (ByVal wSegment As Integer) As Integer
  155. Declare Function UnlockSegment Lib "Kernel" (ByVal wSegment As Integer) As Integer
  156.  
  157. '  Local Memory Flags
  158. Global Const LMEM_FIXED = &H0
  159. Global Const LMEM_MOVEABLE = &H2
  160. Global Const LMEM_NOCOMPACT = &H10
  161. Global Const LMEM_NODISCARD = &H20
  162. Global Const LMEM_ZEROINIT = &H40
  163. Global Const LMEM_MODIFY = &H80
  164. Global Const LMEM_DISCARDABLE = &HF00
  165.  
  166. Global Const LHND = (LMEM_MOVEABLE+LMEM_ZEROINIT)
  167. Global Const LPTR = (LMEM_FIXED+LMEM_ZEROINIT)
  168.  
  169. Global Const NONZEROLHND = (LMEM_MOVEABLE)
  170. Global Const NONZEROLPTR = (LMEM_FIXED)
  171.  
  172. Global Const LNOTIFY_OUTOFMEM = 0
  173. Global Const LNOTIFY_MOVE = 1
  174. Global Const LNOTIFY_DISCARD = 2
  175.  
  176. Declare Function LocalAlloc Lib "Kernel" (ByVal wFlags As Integer, ByVal wBytes As Integer) As Integer
  177. Declare Function LocalCompact Lib "Kernel" (ByVal wMinFree As Integer) As Integer
  178. Declare Function LocalFree Lib "Kernel" (ByVal hMem As Integer) As Integer
  179. Declare Function LocalHandle Lib "Kernel" (ByVal wMem As Integer) As Integer
  180. Declare Function LocalInit Lib "Kernel" (ByVal wSegment As Integer, ByVal pStart As Integer, ByVal pEnd As Integer) As Integer
  181. Declare Function LocalLock Lib "Kernel" (ByVal hMem As Integer) As Integer '(returns a near pointer)
  182. Declare Function LocalReAlloc Lib "Kernel" (ByVal hMem As Integer, ByVal wBytes As Integer, ByVal wFlags As Integer) As Integer
  183.  
  184. 'NOTE: instead of declaring the function LocalDiscard and calling 
  185. '      LocalDiscard(hMem), call LocalReAlloc(hMem, 0, LMEM_MOVEABLE)
  186.  
  187. Declare Function LocalSize Lib "Kernel" (ByVal hMem As Integer) As Integer
  188. Declare Function LocalUnlock Lib "Kernel" (ByVal hMem As Integer) As Integer
  189. Declare Function LocalFlags Lib "Kernel" (ByVal hMem As Integer) As Integer
  190. Declare Function LocalShrink Lib "Kernel" (ByVal hSeg As Integer, ByVal wSize As Integer) As Integer
  191.  
  192. '  Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE)
  193. Global Const LMEM_DISCARDED = &H4000
  194. Global Const LMEM_LOCKCOUNT = &HFF
  195.  
  196. Declare Function SetSwapAreaSize Lib "Kernel" (ByVal rsSize As Integer) As Long
  197. Declare Function ValidateFreeSpaces Lib "Kernel" () As Long
  198. Declare Sub LimitEmsPages Lib "Kernel" (ByVal dwKbytes As Long)
  199. Declare Function SetErrorMode Lib "Kernel" (ByVal wMode As Integer) As Integer
  200. Declare Sub ValidateCodeSegments Lib "Kernel" ()
  201.  
  202. Declare Function GetDOSEnvironment Lib "Kernel" () As Long
  203.  
  204. Declare Function AllocDStoCSAlias Lib "Kernel" (ByVal wSelector As Integer) As Integer
  205. Declare Function AllocSelector Lib "Kernel" (ByVal wSelector As Integer) As Integer
  206. Declare Function ChangeSelector Lib "Kernel" (ByVal wDestSelector As Integer, ByVal wSourceSelector As Integer) As Integer
  207. Declare Function FreeSelector Lib "Kernel" (ByVal wSelector As Integer) As Integer
  208. Declare Function FindResource Lib "Kernel" (ByVal hInstance As Integer, ByVal lpName As String, ByVal lpType As Any) As Integer
  209. Declare Function LoadResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer) As Integer
  210. Declare Function FreeResource Lib "Kernel" (ByVal hResData As Integer) As Integer
  211. Declare Function LockResource Lib "Kernel" (ByVal hResData As Integer) As Long
  212. Declare Function AllocResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer, ByVal dwSize As Long) As Integer
  213. Declare Function SizeofResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer) As Integer
  214. Declare Function AccessResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer) As Integer
  215.  
  216. '  Predefined Resource Types
  217. Global Const RT_CURSOR = 1&
  218. Global Const RT_BITMAP = 2&
  219. Global Const RT_ICON = 3&
  220. Global Const RT_MENU = 4&
  221. Global Const RT_DIALOG = 5&
  222. Global Const RT_STRING = 6&
  223. Global Const RT_FONTDIR = 7&
  224. Global Const RT_FONT = 8&
  225. Global Const RT_ACCELERATOR = 9&
  226. Global Const RT_RCDATA = 10&
  227.  
  228. Declare Sub Yield Lib "Kernel" ()
  229. Declare Function GetCurrentTask Lib "Kernel" () As Integer
  230.  
  231. Declare Function InitAtomTable Lib "Kernel" (ByVal nSize As Integer) As Integer
  232. Declare Function AddAtom Lib "Kernel" (ByVal lpString As String) As Integer
  233. Declare Function DeleteAtom Lib "Kernel" (ByVal nAtom As Integer) As Integer
  234. Declare Function FindAtom Lib "Kernel" (ByVal lpString As String) As Integer
  235. Declare Function GetAtomName Lib "Kernel" (ByVal nAtom As Integer, ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  236. Declare Function GlobalAddAtom Lib "Kernel" (ByVal lpString As String) As Integer
  237. Declare Function GlobalDeleteAtom Lib "Kernel" (ByVal nAtom As Integer) As Integer
  238. Declare Function GlobalFindAtom Lib "Kernel" (ByVal lpString As String) As Integer
  239. Declare Function GlobalGetAtomName Lib "Kernel" (ByVal nAtom As Integer, ByVal lpbuffer As String, ByVal nSize As Integer) As Integer
  240. Declare Function GetAtomHandle Lib "Kernel" (ByVal wAtom As Integer) As Integer
  241.  
  242.  
  243. '  User Profile Routines
  244. Declare Function GetProfileInt Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As Integer) As Integer
  245. Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer) As Integer
  246. Declare Function WriteProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String) As Integer
  247. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  248. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  249. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lplFileName As String) As Integer
  250. Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  251. Declare Function GetSystemDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  252.  
  253. 'NOTE: Catch/Throw expect a long pointer to an 18-byte buffer (lpCatchBuf)
  254. ' eg:
  255. '     Dim Buffer(1 To 9) As Integer
  256. '    result% = Catch (Buffer(1))        
  257.  
  258. Declare Function Catch Lib "Kernel" (lpCatchBuf As Any) As Integer
  259. Declare Sub Throw Lib "Kernel" (lpCatchBuf As Any, ByVal nThrowBack As Integer)
  260.  
  261. Declare Sub FatalExit Lib "Kernel" (ByVal Code As Integer)
  262. Declare Sub SwapRecording Lib "Kernel" (ByVal wFlag As Integer)
  263.  
  264. '  Character Translation Routines
  265. Declare Function AnsiToOem Lib "Keyboard" (ByVal lpAnsiStr As String, ByVal lpOemStr As String) As Integer
  266. Declare Function OemToAnsi Lib "Keyboard" (ByVal lpOemStr As String, ByVal lpAnsiStr As String) As Integer
  267. Declare Sub AnsiToOemBuff Lib "Keyboard" (ByVal lpAnsiStr As String, ByVal lpOemStr As String, ByVal nLength As Integer)
  268. Declare Sub OemToAnsiBuff Lib "Keyboard" (ByVal lpOemStr As String, ByVal lpAnsiStr As String, ByVal nLength as Integer)
  269. Declare Function AnsiUpper Lib "User" (ByVal lpString As String) As String
  270. Declare Function AnsiUpperBuff Lib "User" (ByVal lpString As String, ByVal aWORD As Integer) As Integer
  271. Declare Function AnsiLower Lib "User" (ByVal lpString As String) As Long
  272. Declare Function AnsiLowerBuff Lib "User" (ByVal lpString As String, ByVal aWORD As Integer) As Integer
  273. Declare Function AnsiNext Lib "User" (ByVal lpString As String) As Long
  274. Declare Function AnsiPrev Lib "User" (ByVal lpString As String, ByVal lpString As String) As Long
  275.  
  276. '  Keyboard Information Routines
  277. Declare Function OemKeyScan Lib "Keyboard" (ByVal wOemChar As Integer) As Long
  278. Declare Function VkKeyScan Lib "Keyboard" (ByVal cChar As Integer) As Integer
  279. Declare Function GetKeyboardType Lib "Keyboard" (ByVal nTypeFlag As Integer) As Integer
  280. Declare Function MapVirtualKey Lib "Keyboard" (ByVal wCode As Integer, ByVal wMapType As Integer) As Integer
  281. Declare Function GetKBCodePage Lib "Keyboard" ()
  282. Declare Function GetKeyNameText Lib "Keyboard" (ByVal lParam As Long, ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  283. Declare Function ToAscii Lib "Keyboard" (ByVal wVirtKey As Integer, ByVal wScanCode As Integer, lpKeyState As Any, lpChar As Any, Byval wFlags As Integer) As Integer
  284.  
  285. '  Language dependent Routines
  286. Declare Function IsCharAlpha Lib "User" (ByVal cChar As Integer) As Integer
  287. Declare Function IsCharAlphaNumeric Lib "User" (ByVal cChar As Integer) As Integer
  288. Declare Function IsCharUpper Lib "User" (ByVal cChar As Integer) As Integer
  289. Declare Function IsCharLower Lib "User" (ByVal cChar As Integer) As Integer
  290.  
  291. Declare Function GetWinFlags Lib "Kernel" () As Long
  292.  
  293. Global Const WF_PMODE = &H1
  294. Global Const WF_CPU286 = &H2
  295. Global Const WF_CPU386 = &H4
  296. Global Const WF_CPU486 = &H8
  297. Global Const WF_STANDARD = &H10
  298. Global Const WF_WIN286 = &H10
  299. Global Const WF_ENHANCED = &H20
  300. Global Const WF_WIN386 = &H20
  301. Global Const WF_CPU086 = &H40
  302. Global Const WF_CPU186 = &H80
  303. Global Const WF_LARGEFRAME = &H100
  304. Global Const WF_SMALLFRAME = &H200
  305. Global Const WF_80x87 = &H400
  306.  
  307. '  WEP fSystemExit flag values
  308. Global Const WEP_SYSTEM_EXIT = 1
  309. Global Const WEP_FREE_DLL = 0
  310.  
  311. '  OEM Resource Ordinal Numbers
  312. Global Const OBM_CLOSE = 32754
  313. Global Const OBM_UPARROW = 32753
  314. Global Const OBM_DNARROW = 32752
  315. Global Const OBM_RGARROW = 32751
  316. Global Const OBM_LFARROW = 32750
  317. Global Const OBM_REDUCE = 32749
  318. Global Const OBM_ZOOM = 32748
  319. Global Const OBM_RESTORE = 32747
  320. Global Const OBM_REDUCED = 32746
  321. Global Const OBM_ZOOMD = 32745
  322. Global Const OBM_RESTORED = 32744
  323. Global Const OBM_UPARROWD = 32743
  324. Global Const OBM_DNARROWD = 32742
  325. Global Const OBM_RGARROWD = 32741
  326. Global Const OBM_LFARROWD = 32740
  327. Global Const OBM_MNARROW = 32739
  328. Global Const OBM_COMBO = 32738
  329.  
  330. Global Const OBM_OLD_CLOSE = 32767
  331. Global Const OBM_SIZE = 32766
  332. Global Const OBM_OLD_UPARROW = 32765
  333. Global Const OBM_OLD_DNARROW = 32764
  334. Global Const OBM_OLD_RGARROW = 32763
  335. Global Const OBM_OLD_LFARROW = 32762
  336. Global Const OBM_BTSIZE = 32761
  337. Global Const OBM_CHECK = 32760
  338. Global Const OBM_CHECKBOXES = 32759
  339. Global Const OBM_BTNCORNERS = 32758
  340. Global Const OBM_OLD_REDUCE = 32757
  341. Global Const OBM_OLD_ZOOM = 32756
  342. Global Const OBM_OLD_RESTORE = 32755
  343.  
  344. Global Const OCR_NORMAL = 32512
  345. Global Const OCR_IBEAM = 32513
  346. Global Const OCR_WAIT = 32514
  347. Global Const OCR_CROSS = 32515
  348. Global Const OCR_UP = 32516
  349. Global Const OCR_SIZE = 32640
  350. Global Const OCR_ICON = 32641
  351. Global Const OCR_SIZENWSE = 32642
  352. Global Const OCR_SIZENESW = 32643
  353. Global Const OCR_SIZEWE = 32644
  354. Global Const OCR_SIZENS = 32645
  355. Global Const OCR_SIZEALL = 32646
  356. Global Const OCR_ICOCUR = 32647
  357.  
  358. Global Const OIC_SAMPLE = 32512
  359. Global Const OIC_HAND = 32513
  360. Global Const OIC_QUES = 32514
  361. Global Const OIC_BANG = 32515
  362. Global Const OIC_NOTE = 32516
  363.  
  364.  
  365. ' --------------------------------------------------------------------------
  366. '   GDI Section
  367. ' --------------------------------------------------------------------------
  368.  
  369. '  Binary raster ops
  370. Global Const R2_BLACK = 1    '   0
  371. Global Const R2_NOTMERGEPEN = 2    '  DPon
  372. Global Const R2_MASKNOTPEN = 3    '  DPna
  373. Global Const R2_NOTCOPYPEN = 4    '  PN
  374. Global Const R2_MASKPENNOT = 5    '  PDna
  375. Global Const R2_NOT = 6    '  Dn
  376. Global Const R2_XORPEN = 7    '  DPx
  377. Global Const R2_NOTMASKPEN = 8    '  DPan
  378. Global Const R2_MASKPEN = 9    '  DPa
  379. Global Const R2_NOTXORPEN = 10    '  DPxn
  380. Global Const R2_NOP = 11    '  D
  381. Global Const R2_MERGENOTPEN = 12    '  DPno
  382. Global Const R2_COPYPEN = 13    '  P
  383. Global Const R2_MERGEPENNOT = 14    '  PDno
  384. Global Const R2_MERGEPEN = 15    '  DPo
  385. Global Const R2_WHITE = 16    '   1
  386.  
  387. '   Ternary raster operations
  388. Global Const SRCCOPY = &HCC0020    ' (DWORD) dest = source
  389. Global Const SRCPAINT = &HEE0086    ' (DWORD) dest = source OR dest
  390. Global Const SRCAND = &H8800C6    ' (DWORD) dest = source AND dest
  391. Global Const SRCINVERT = &H660046    ' (DWORD) dest = source XOR dest
  392. Global Const SRCERASE = &H440328    ' (DWORD) dest = source AND (NOT dest )
  393. Global Const NOTSRCCOPY = &H330008    ' (DWORD) dest = (NOT source)
  394. Global Const NOTSRCERASE = &H1100A6    ' (DWORD) dest = (NOT src) AND (NOT dest)
  395. Global Const MERGECOPY = &HC000CA    ' (DWORD) dest = (source AND pattern)
  396. Global Const MERGEPAINT = &HBB0226    ' (DWORD) dest = (NOT source) OR dest
  397. Global Const PATCOPY = &HF00021    ' (DWORD) dest = pattern
  398. Global Const PATPAINT = &HFB0A09    ' (DWORD) dest = DPSnoo
  399. Global Const PATINVERT = &H5A0049    ' (DWORD) dest = pattern XOR dest
  400. Global Const DSTINVERT = &H550009    ' (DWORD) dest = (NOT dest)
  401. Global Const BLACKNESS = &H42&    ' (DWORD) dest = BLACK
  402. Global Const WHITENESS = &HFF0062    ' (DWORD) dest = WHITE
  403.  
  404.  
  405. '  StretchBlt() Modes
  406. Global Const BLACKONWHITE = 1
  407. Global Const WHITEONBLACK = 2
  408. Global Const COLORONCOLOR = 3
  409.  
  410. '  PolyFill() Modes
  411. Global Const ALTERNATE = 1
  412. Global Const WINDING = 2
  413.  
  414. '  Text Alignment Options
  415. Global Const TA_NOUPDATECP = 0
  416. Global Const TA_UPDATECP = 1
  417.  
  418. Global Const TA_LEFT = 0
  419. Global Const TA_RIGHT = 2
  420. Global Const TA_CENTER = 6
  421.  
  422. Global Const TA_TOP = 0
  423. Global Const TA_BOTTOM = 8
  424. Global Const TA_BASELINE = 24
  425.  
  426. Global Const ETO_GRAYED = 1
  427. Global Const ETO_OPAQUE = 2
  428. Global Const ETO_CLIPPED = 4
  429.  
  430. Global Const ASPECT_FILTERING = &H1
  431.  
  432. '  Metafile Functions
  433. Global Const META_SETBKCOLOR = &H201
  434. Global Const META_SETBKMODE = &H102
  435. Global Const META_SETMAPMODE = &H103
  436. Global Const META_SETROP2 = &H104
  437. Global Const META_SETRELABS = &H105
  438. Global Const META_SETPOLYFILLMODE = &H106
  439. Global Const META_SETSTRETCHBLTMODE = &H107
  440. Global Const META_SETTEXTCHAREXTRA = &H108
  441. Global Const META_SETTEXTCOLOR = &H209
  442. Global Const META_SETTEXTJUSTIFICATION = &H20A
  443. Global Const META_SETWINDOWORG = &H20B
  444. Global Const META_SETWINDOWEXT = &H20C
  445. Global Const META_SETVIEWPORTORG = &H20D
  446. Global Const META_SETVIEWPORTEXT = &H20E
  447. Global Const META_OFFSETWINDOWORG = &H20F
  448. Global Const META_SCALEWINDOWEXT = &H400
  449. Global Const META_OFFSETVIEWPORTORG = &H211
  450. Global Const META_SCALEVIEWPORTEXT = &H412
  451. Global Const META_LINETO = &H213
  452. Global Const META_MOVETO = &H214
  453. Global Const META_EXCLUDECLIPRECT = &H415
  454. Global Const META_INTERSECTCLIPRECT = &H416
  455. Global Const META_ARC = &H817
  456. Global Const META_ELLIPSE = &H418
  457. Global Const META_FLOODFILL = &H419
  458. Global Const META_PIE = &H81A
  459. Global Const META_RECTANGLE = &H41B
  460. Global Const META_ROUNDRECT = &H61C
  461. Global Const META_PATBLT = &H61D
  462. Global Const META_SAVEDC = &H1E
  463. Global Const META_SETPIXEL = &H41F
  464. Global Const META_OFFSETCLIPRGN = &H220
  465. Global Const META_TEXTOUT = &H521
  466. Global Const META_BITBLT = &H922
  467. Global Const META_STRETCHBLT = &HB23
  468. Global Const META_POLYGON = &H324
  469. Global Const META_POLYLINE = &H325
  470. Global Const META_ESCAPE = &H626
  471. Global Const META_RESTOREDC = &H127
  472. Global Const META_FILLREGION = &H228
  473. Global Const META_FRAMEREGION = &H429
  474. Global Const META_INVERTREGION = &H12A
  475. Global Const META_PAINTREGION = &H12B
  476. Global Const META_SELECTCLIPREGION = &H12C
  477. Global Const META_SELECTOBJECT = &H12D
  478. Global Const META_SETTEXTALIGN = &H12E
  479. Global Const META_DRAWTEXT = &H62F
  480.  
  481. Global Const META_CHORD = &H830
  482. Global Const META_SETMAPPERFLAGS = &H231
  483. Global Const META_EXTTEXTOUT = &Ha32
  484. Global Const META_SETDIBTODEV = &Hd33
  485. Global Const META_SELECTPALETTE = &H234
  486. Global Const META_REALIZEPALETTE = &H35
  487. Global Const META_ANIMATEPALETTE = &H436
  488. Global Const META_SETPALENTRIES = &H37
  489. Global Const META_POLYPOLYGON = &H538
  490. Global Const META_RESIZEPALETTE = &H139
  491.  
  492. Global Const META_DIBBITBLT = &H940
  493. Global Const META_DIBSTRETCHBLT = &Hb41
  494. Global Const META_DIBCREATEPATTERNBRUSH = &H142
  495. Global Const META_STRETCHDIB = &Hf43
  496.  
  497. Global Const META_DELETEOBJECT = &H1f0
  498.  
  499. Global Const META_CREATEPALETTE = &Hf7
  500. Global Const META_CREATEBRUSH = &HF8
  501. Global Const META_CREATEPATTERNBRUSH = &H1F9
  502. Global Const META_CREATEPENINDIRECT = &H2FA
  503. Global Const META_CREATEFONTINDIRECT = &H2FB
  504. Global Const META_CREATEBRUSHINDIRECT = &H2FC
  505. Global Const META_CREATEBITMAPINDIRECT = &H2FD
  506. Global Const META_CREATEBITMAP = &H6FE
  507. Global Const META_CREATEREGION = &H6FF
  508.  
  509.  
  510. '  GDI Escapes
  511. Global Const NEWFRAME = 1
  512. Global Const ABORTDOC = 2
  513. Global Const NEXTBAND = 3
  514. Global Const SETCOLORTABLE = 4
  515. Global Const GETCOLORTABLE = 5
  516. Global Const FLUSHOUTPUT = 6
  517. Global Const DRAFTMODE = 7
  518. Global Const QUERYESCSUPPORT = 8
  519. Global Const SETABORTPROC = 9
  520. Global Const STARTDOC = 10
  521. Global Const ENDDOCAPI = 11
  522. Global Const GETPHYSPAGESIZE = 12
  523. Global Const GETPRINTINGOFFSET = 13
  524. Global Const GETSCALINGFACTOR = 14
  525. Global Const MFCOMMENT = 15
  526. Global Const GETPENWIDTH = 16
  527. Global Const SETCOPYCOUNT = 17
  528. Global Const SELECTPAPERSOURCE = 18
  529. Global Const DEVICEDATA = 19
  530. Global Const PASSTHROUGH = 19
  531. Global Const GETTECHNOLGY = 20
  532. Global Const GETTECHNOLOGY = 20
  533. Global Const SETENDCAP = 21
  534. Global Const SETLINEJOIN = 22
  535. Global Const SETMITERLIMIT = 23
  536. Global Const BANDINFO = 24
  537. Global Const DRAWPATTERNRECT = 25
  538. Global Const GETVECTORPENSIZE = 26
  539. Global Const GETVECTORBRUSHSIZE = 27
  540. Global Const ENABLEDUPLEX = 28
  541. Global Const GETSETPAPERBINS = 29
  542. Global Const GETSETPRINTORIENT = 30
  543. Global Const ENUMPAPERBINS = 31
  544. Global Const SETDIBSCALING = 32
  545. Global Const EPSPRINTING = 33
  546. Global Const ENUMPAPERMETRICS = 34
  547. Global Const GETSETPAPERMETRICS = 35
  548. Global Const POSTSCRIPT_DATA = 37
  549. Global Const POSTSCRIPT_IGNORE = 38
  550. Global Const GETEXTENDEDTEXTMETRICS = 256
  551. Global Const GETEXTENTTABLE = 257
  552. Global Const GETPAIRKERNTABLE = 258
  553. Global Const GETTRACKKERNTABLE = 259
  554. Global Const EXTTEXTOUT = 512
  555. Global Const ENABLERELATIVEWIDTHS = 768
  556. Global Const ENABLEPAIRKERNING = 769
  557. Global Const SETKERNTRACK = 770
  558. Global Const SETALLJUSTVALUES = 771
  559. Global Const SETCHARSET = 772
  560.  
  561. Global Const STRETCHBLT = 2048
  562. Global Const BEGIN_PATH = 4096
  563. Global Const CLIP_TO_PATH = 4097
  564. Global Const END_PATH = 4098
  565. Global Const EXT_DEVICE_CAPS = 4099
  566. Global Const RESTORE_CTM = 4100
  567. Global Const SAVE_CTM = 4101
  568. Global Const SET_ARC_DIRECTION = 4102
  569. Global Const SET_BACKGROUND_COLOR = 4103
  570. Global Const SET_POLY_MODE = 4104
  571. Global Const SET_SCREEN_ANGLE = 4105
  572. Global Const SET_SPREAD = 4106
  573. Global Const TRANSFORM_CTM = 4107
  574. Global Const SET_CLIP_BOX = 4108
  575. Global Const SET_BOUNDS = 4109
  576. Global Const SET_MIRROR_MODE = 4110
  577.  
  578. '  Spooler Error Codes
  579. Global Const SP_NOTREPORTED = &H4000
  580. Global Const SP_ERROR = (-1)
  581. Global Const SP_APPABORT = (-2)
  582. Global Const SP_USERABORT = (-3)
  583. Global Const SP_OUTOFDISK = (-4)
  584. Global Const SP_OUTOFMEMORY = (-5)
  585.  
  586. Global Const PR_JOBSTATUS = &H0
  587.  
  588. '  Bitmap Header Definition
  589. Type BITMAP '14 bytes
  590.     bmType As Integer
  591.     bmWidth As Integer
  592.     bmHeight As Integer
  593.     bmWidthBytes As Integer
  594.     bmPlanes As String * 1
  595.     bmBitsPixel As String * 1
  596.     bmBits As Long
  597. End Type
  598.  
  599. Type RGBTRIPLE 
  600.     rgbtBlue As String * 1
  601.     rgbtGreen As String * 1
  602.     rgbtRed As String * 1
  603. End Type
  604.  
  605. Type RGBQUAD
  606.     rgbBlue as String * 1
  607.     rgbGreen As String * 1
  608.     rgbRed As String * 1
  609.     rgbReserved As String * 1
  610. End Type
  611.  
  612. '  structures for defining DIBs
  613. Type BITMAPCOREHEADER '12 bytes
  614.     bcSize as Long
  615.     bcWidth As Integer
  616.     bcHeight As Integer
  617.     bcPlanes As Integer
  618.     bcBitCount As Integer
  619. End Type
  620.  
  621. Type BITMAPINFOHEADER '40 bytes
  622.     biSize As Long
  623.     biWidth As Long
  624.     biHeight As Long
  625.     biPlanes As Integer
  626.     biBitCount As Integer
  627.     biCompression As Long
  628.     biSizeImage As Long
  629.     biXPelsPerMeter As Long
  630.     biYPelsPerMeter As Long
  631.     biClrUsed As Long
  632.     biClrImportant As Long
  633. End Type
  634.  
  635. '  constants for the biCompression field
  636. Global Const BI_RGB = 0&
  637. Global Const BI_RLE8 = 1&
  638. Global Const BI_RLE4 = 2&
  639.  
  640. Type BITMAPINFO
  641.     bmiHeader as BITMAPINFOHEADER
  642.     bmiColors As String * 128 ' Array length is arbitrary; may be changed
  643. End Type
  644.  
  645. Type BITMAPCOREINFO
  646.     bmciHeader As BITMAPCOREHEADER
  647.     bmciColors As String * 96 ' Array length is arbitrary; may be changed
  648. End Type
  649.  
  650. Type BITMAPFILEHEADER
  651.     bfType As Integer
  652.     bfSize As Long
  653.     bfReserved1 As Integer
  654.     bfReserved2 As Integer
  655.     bfOffBits As Long
  656. End Type
  657.  
  658.  
  659. '  Clipboard Metafile Picture Structure
  660. Type HANDLETABLE
  661.     objectHandle As String * 512 ' Array length is arbitrary; may be changed
  662. End Type
  663.  
  664. Type METARECORD
  665.     rdSize As Long
  666.     rdFunction As Integer
  667.     rdParm As String * 512 ' Array length is arbitrary; may be changed
  668. End Type
  669.  
  670.  
  671. Type METAFILEPICT
  672.     mm As Integer
  673.     xExt As Integer
  674.     yExt As Integer
  675.     hMF As Integer
  676. End Type
  677.  
  678. Type METAHEADER
  679.     mtType As Integer
  680.     mtHeaderSize As Integer
  681.     mtVersion As Integer
  682.     mtSize As Long
  683.     mtNoObjects As Integer
  684.     mtMaxRecord As Long
  685.     mtNoParameters As Integer
  686. End Type
  687.  
  688. Type TEXTMETRIC
  689.     tmHeight As Integer
  690.     tmAscent As Integer
  691.     tmDescent As Integer
  692.     tmInternalLeading As Integer
  693.     tmExternalLeading As Integer
  694.     tmAveCharWidth As Integer
  695.     tmMaxCharWidth As Integer
  696.     tmWeight As Integer
  697.     tmItalic As String * 1
  698.     tmUnderlined As String * 1
  699.     tmStruckOut As String * 1
  700.     tmFirstChar As String * 1
  701.     tmLastChar As String * 1
  702.     tmDefaultChar As String * 1
  703.     tmBreakChar As String * 1
  704.     tmPitchAndFamily As String * 1
  705.     tmCharSet As String * 1
  706.     tmOverhang As Integer
  707.     tmDigitizedAspectX As Integer
  708.     tmDigitizedAspectY As Integer
  709. End Type
  710.  
  711. '  GDI Logical Objects:
  712.  
  713. '  Pel Array
  714. Type PELARRAY
  715.     paXCount As Integer
  716.     paYCount As Integer
  717.     paXExt As Integer
  718.     paYExt As Integer
  719.     paRGBs As Integer
  720. End Type
  721.  
  722. '  Logical Brush (or Pattern)
  723. Type LOGBRUSH
  724.     lbStyle As Integer
  725.     lbColor As Long
  726.     lbHatch As Integer
  727. End Type
  728.  
  729. '  Logical Pen
  730. Type LOGPEN
  731.     lopnStyle As Integer
  732.     lopnWidth As POINTAPI
  733.     lopnColor As Long
  734. End Type
  735.  
  736. Type PALETTEENTRY
  737.     peRed As String * 1
  738.     peGreen As String * 1
  739.     peBlue As String * 1
  740.     peFlags As String * 1
  741. End Type
  742.  
  743. '  Logical Palette
  744. Type LOGPALETTE
  745.     palVersion As Integer
  746.     palNumEntries As Integer
  747.     palPalEntry As String * 252 ' Array length is arbitrary; may be changed
  748. End Type
  749.  
  750. '  Logical Font
  751. Global Const LF_FACESIZE = 32
  752.  
  753. Type LOGFONT
  754.     lfHeight As Integer
  755.     lfWidth As Integer
  756.     lfEscapement As Integer
  757.     lfOrientation As Integer
  758.     lfWeight As Integer
  759.     lfItalic As String * 1
  760.     lfUnderline As String * 1
  761.     lfStrikeOut As String * 1
  762.     lfCharSet As String * 1
  763.     lfOutPrecision As String * 1
  764.     lfClipPrecision As String * 1
  765.     lfQuality As String * 1
  766.     lfPitchAndFamily As String * 1
  767.     lfFaceName As String * LF_FACESIZE
  768. End Type
  769.  
  770. Global Const OUT_DEFAULT_PRECIS = 0
  771. Global Const OUT_STRING_PRECIS = 1
  772. Global Const OUT_CHARACTER_PRECIS = 2
  773. Global Const OUT_STROKE_PRECIS = 3
  774.  
  775. Global Const CLIP_DEFAULT_PRECIS = 0
  776. Global Const CLIP_CHARACTER_PRECIS = 1
  777. Global Const CLIP_STROKE_PRECIS = 2
  778.  
  779. Global Const DEFAULT_QUALITY = 0
  780. Global Const DRAFT_QUALITY = 1
  781. Global Const PROOF_QUALITY = 2
  782.  
  783. Global Const DEFAULT_PITCH = 0
  784. Global Const FIXED_PITCH = 1
  785. Global Const VARIABLE_PITCH = 2
  786.  
  787. Global Const ANSI_CHARSET = 0
  788. Global Const SYMBOL_CHARSET = 2
  789. Global Const SHIFTJIS_CHARSET = 128
  790. Global Const OEM_CHARSET = 255
  791.  
  792. '  Font Families
  793. '
  794. Global Const FF_DONTCARE = 0    '  Don't care or don't know.
  795. Global Const FF_ROMAN = 16    '  Variable stroke width, serifed.
  796.  
  797. '  Times Roman, Century Schoolbook, etc.
  798. Global Const FF_SWISS = 32    '  Variable stroke width, sans-serifed.
  799.  
  800. '  Helvetica, Swiss, etc.
  801. Global Const FF_MODERN = 48    '  Constant stroke width, serifed or sans-serifed.
  802.  
  803. '  Pica, Elite, Courier, etc.
  804. Global Const FF_SCRIPT = 64    '  Cursive, etc.
  805. Global Const FF_DECORATIVE = 80    '  Old English, etc.
  806.  
  807. '  Font Weights
  808. Global Const FW_DONTCARE = 0
  809. Global Const FW_THIN = 100
  810. Global Const FW_EXTRALIGHT = 200
  811. Global Const FW_LIGHT = 300
  812. Global Const FW_NORMAL = 400
  813. Global Const FW_MEDIUM = 500
  814. Global Const FW_SEMIBOLD = 600
  815. Global Const FW_BOLD = 700
  816. Global Const FW_EXTRABOLD = 800
  817. Global Const FW_HEAVY = 900
  818.  
  819. Global Const FW_ULTRALIGHT = FW_EXTRALIGHT
  820. Global Const FW_REGULAR = FW_NORMAL
  821. Global Const FW_DEMIBOLD = FW_SEMIBOLD
  822. Global Const FW_ULTRABOLD = FW_EXTRABOLD
  823. Global Const FW_BLACK = FW_HEAVY
  824.  
  825. '  Background Modes
  826. Global Const TRANSPARENT = 1
  827. Global Const OPAQUE = 2
  828.  
  829. '  Mapping Modes
  830. Global Const MM_TEXT = 1
  831. Global Const MM_LOMETRIC = 2
  832. Global Const MM_HIMETRIC = 3
  833. Global Const MM_LOENGLISH = 4
  834. Global Const MM_HIENGLISH = 5
  835. Global Const MM_TWIPS = 6
  836. Global Const MM_ISOTROPIC = 7
  837. Global Const MM_ANISOTROPIC = 8
  838.  
  839. '  Coordinate Modes
  840. Global Const ABSOLUTE = 1
  841. Global Const RELATIVE = 2
  842.  
  843. '  Stock Logical Objects
  844. Global Const WHITE_BRUSH = 0
  845. Global Const LTGRAY_BRUSH = 1
  846. Global Const GRAY_BRUSH = 2
  847. Global Const DKGRAY_BRUSH = 3
  848. Global Const BLACK_BRUSH = 4
  849. Global Const NULL_BRUSH = 5
  850. Global Const HOLLOW_BRUSH = NULL_BRUSH
  851. Global Const WHITE_PEN = 6
  852. Global Const BLACK_PEN = 7
  853. Global Const NULL_PEN = 8
  854. Global Const OEM_FIXED_FONT = 10
  855. Global Const ANSI_FIXED_FONT = 11
  856. Global Const ANSI_VAR_FONT = 12
  857. Global Const SYSTEM_FONT = 13
  858. Global Const DEVICE_DEFAULT_FONT = 14
  859. Global Const DEFAULT_PALETTE = 15
  860. Global Const SYSTEM_FIXED_FONT = 16
  861.  
  862. '  Brush Styles
  863. Global Const BS_SOLID = 0
  864. Global Const BS_NULL = 1
  865. Global Const BS_HOLLOW = BS_NULL
  866. Global Const BS_HATCHED = 2
  867. Global Const BS_PATTERN = 3
  868. Global Const BS_INDEXED = 4
  869. Global Const BS_DIBPATTERN = 5
  870.  
  871. '  Hatch Styles
  872. Global Const HS_HORIZONTAL = 0    '  -----
  873. Global Const HS_VERTICAL = 1    '  |||||
  874. Global Const HS_FDIAGONAL = 2    '  \\\\\
  875. Global Const HS_BDIAGONAL = 3    '  /////
  876. Global Const HS_CROSS = 4    '  +++++
  877. Global Const HS_DIAGCROSS = 5    '  xxxxx
  878.  
  879. '  Pen Styles
  880. Global Const PS_SOLID = 0
  881. Global Const PS_DASH = 1    '  -------
  882. Global Const PS_DOT = 2    '  .......
  883. Global Const PS_DASHDOT = 3    '  _._._._
  884. Global Const PS_DASHDOTDOT = 4    '  _.._.._
  885. Global Const PS_NULL = 5
  886. Global Const PS_INSIDEFRAME = 6
  887.  
  888. '  Device Parameters for GetDeviceCaps()
  889. Global Const DRIVERVERSION = 0    '  Device driver version
  890. Global Const TECHNOLOGY = 2    '  Device classification
  891. Global Const HORZSIZE = 4    '  Horizontal size in millimeters
  892. Global Const VERTSIZE = 6    '  Vertical size in millimeters
  893. Global Const HORZRES = 8    '  Horizontal width in pixels
  894. Global Const VERTRES = 10    '  Vertical width in pixels
  895. Global Const BITSPIXEL = 12    '  Number of bits per pixel
  896. Global Const PLANES = 14    '  Number of planes
  897. Global Const NUMBRUSHES = 16    '  Number of brushes the device has
  898. Global Const NUMPENS = 18    '  Number of pens the device has
  899. Global Const NUMMARKERS = 20    '  Number of markers the device has
  900. Global Const NUMFONTS = 22    '  Number of fonts the device has
  901. Global Const NUMCOLORS = 24    '  Number of colors the device supports
  902. Global Const PDEVICESIZE = 26    '  Size required for device descriptor
  903. Global Const CURVECAPS = 28    '  Curve capabilities
  904. Global Const LINECAPS = 30    '  Line capabilities
  905. Global Const POLYGONALCAPS = 32    '  Polygonal capabilities
  906. Global Const TEXTCAPS = 34    '  Text capabilities
  907. Global Const CLIPCAPS = 36    '  Clipping capabilities
  908. Global Const RASTERCAPS = 38    '  Bitblt capabilities
  909. Global Const ASPECTX = 40    '  Length of the X leg
  910. Global Const ASPECTY = 42    '  Length of the Y leg
  911. Global Const ASPECTXY = 44    '  Length of the hypotenuse
  912.  
  913. Global Const LOGPIXELSX = 88    '  Logical pixels/inch in X
  914. Global Const LOGPIXELSY = 90    '  Logical pixels/inch in Y
  915.  
  916. Global Const SIZEPALETTE = 104    '  Number of entries in physical palette
  917. Global Const NUMRESERVED = 106    '  Number of reserved entries in palette
  918. Global Const COLORRES = 108    '  Actual color resolution
  919.  
  920.  
  921. '  Device Capability Masks:
  922.  
  923. '  Device Technologies
  924. Global Const DT_PLOTTER = 0    '  Vector plotter
  925. Global Const DT_RASDISPLAY = 1    '  Raster display
  926. Global Const DT_RASPRINTER = 2    '  Raster printer
  927. Global Const DT_RASCAMERA = 3    '  Raster camera
  928. Global Const DT_CHARSTREAM = 4    '  Character-stream, PLP
  929. Global Const DT_METAFILE = 5    '  Metafile, VDM
  930. Global Const DT_DISPFILE = 6    '  Display-file
  931.  
  932. '  Curve Capabilities
  933. Global Const CC_NONE = 0    '  Curves not supported
  934. Global Const CC_CIRCLES = 1    '  Can do circles
  935. Global Const CC_PIE = 2    '  Can do pie wedges
  936. Global Const CC_CHORD = 4    '  Can do chord arcs
  937. Global Const CC_ELLIPSES = 8    '  Can do ellipese
  938. Global Const CC_WIDE = 16    '  Can do wide lines
  939. Global Const CC_STYLED = 32    '  Can do styled lines
  940. Global Const CC_WIDESTYLED = 64    '  Can do wide styled lines
  941. Global Const CC_INTERIORS = 128    '  Can do interiors
  942.  
  943. '  Line Capabilities
  944. Global Const LC_NONE = 0    '  Lines not supported
  945. Global Const LC_POLYLINE = 2    '  Can do polylines
  946. Global Const LC_MARKER = 4    '  Can do markers
  947. Global Const LC_POLYMARKER = 8    '  Can do polymarkers
  948. Global Const LC_WIDE = 16    '  Can do wide lines
  949. Global Const LC_STYLED = 32    '  Can do styled lines
  950. Global Const LC_WIDESTYLED = 64    '  Can do wide styled lines
  951. Global Const LC_INTERIORS = 128    '  Can do interiors
  952.  
  953. '  Polygonal Capabilities
  954. Global Const PC_NONE = 0    '  Polygonals not supported
  955. Global Const PC_POLYGON = 1    '  Can do polygons
  956. Global Const PC_RECTANGLE = 2    '  Can do rectangles
  957. Global Const PC_WINDPOLYGON = 4    '  Can do winding polygons
  958. Global Const PC_TRAPEZOID = 4    '  Can do trapezoids
  959. Global Const PC_SCANLINE = 8    '  Can do scanlines
  960. Global Const PC_WIDE = 16    '  Can do wide borders
  961. Global Const PC_STYLED = 32    '  Can do styled borders
  962. Global Const PC_WIDESTYLED = 64    '  Can do wide styled borders
  963. Global Const PC_INTERIORS = 128    '  Can do interiors
  964.  
  965. '  Polygonal Capabilities
  966. Global Const CP_NONE = 0    '  No clipping of output
  967. Global Const CP_RECTANGLE = 1    '  Output clipped to rects
  968.  
  969. '  Text Capabilities
  970. Global Const TC_OP_CHARACTER = &H1    '  Can do OutputPrecision    CHARACTER
  971. Global Const TC_OP_STROKE = &H2    '  Can do OutputPrecision    STROKE
  972. Global Const TC_CP_STROKE = &H4    '  Can do ClipPrecision    STROKE
  973. Global Const TC_CR_90 = &H8    '  Can do CharRotAbility    90
  974. Global Const TC_CR_ANY = &H10    '  Can do CharRotAbility    ANY
  975. Global Const TC_SF_X_YINDEP = &H20    '  Can do ScaleFreedom    X_YINDEPENDENT
  976. Global Const TC_SA_DOUBLE = &H40    '  Can do ScaleAbility    DOUBLE
  977. Global Const TC_SA_INTEGER = &H80    '  Can do ScaleAbility    INTEGER
  978. Global Const TC_SA_CONTIN = &H100    '  Can do ScaleAbility    CONTINUOUS
  979. Global Const TC_EA_DOUBLE = &H200    '  Can do EmboldenAbility    DOUBLE
  980. Global Const TC_IA_ABLE = &H400    '  Can do ItalisizeAbility    ABLE
  981. Global Const TC_UA_ABLE = &H800    '  Can do UnderlineAbility    ABLE
  982. Global Const TC_SO_ABLE = &H1000    '  Can do StrikeOutAbility    ABLE
  983. Global Const TC_RA_ABLE = &H2000    '  Can do RasterFontAble    ABLE
  984. Global Const TC_VA_ABLE = &H4000    '  Can do VectorFontAble    ABLE
  985. Global Const TC_RESERVED = &H8000
  986.  
  987. '  Raster Capabilities
  988. Global Const RC_BITBLT = 1    '  Can do standard BLT.
  989. Global Const RC_BANDING = 2    '  Device requires banding support
  990. Global Const RC_SCALING = 4    '  Device requires scaling support
  991. Global Const RC_BITMAP64 = 8    '  Device can support >64K bitmap
  992. Global Const RC_GDI20_OUTPUT = &H10    '  has 2.0 output calls
  993. Global Const RC_DI_BITMAP = &H80    '  supports DIB to memory
  994. Global Const RC_PALETTE = &H100    '  supports a palette
  995. Global Const RC_DIBTODEV = &H200    '  supports DIBitsToDevice
  996. Global Const RC_BIGFONT = &H400    '  supports >64K fonts
  997. Global Const RC_STRETCHBLT = &H800    '  supports StretchBlt
  998. Global Const RC_FLOODFILL = &H1000    '  supports FloodFill
  999. Global Const RC_STRETCHDIB = &H2000    '  supports StretchDIBits
  1000.  
  1001. '  palette entry flags
  1002. Global Const PC_RESERVED = &H1    '  palette index used for animation
  1003. Global Const PC_EXPLICIT = &H2    '  palette index is explicit to device
  1004. Global Const PC_NOCOLLAPSE = &H4    '  do not match color to system palette
  1005.  
  1006. '  DIB color table identifiers
  1007. Global Const DIB_RGB_COLORS = 0    '  color table in RGBTriples
  1008. Global Const DIB_PAL_COLORS = 1    '  color table in palette indices
  1009.  
  1010. '  constants for Get/SetSystemPaletteUse()
  1011. Global Const SYSPAL_STATIC = 1
  1012. Global Const SYSPAL_NOSTATIC = 2
  1013.  
  1014. '  constants for CreateDIBitmap
  1015. Global Const CBM_INIT = &H4&    '  initialize bitmap
  1016.  
  1017. '  DrawText() Format Flags
  1018. Global Const DT_TOP = &H0
  1019. Global Const DT_LEFT = &H0
  1020. Global Const DT_CENTER = &H1
  1021. Global Const DT_RIGHT = &H2
  1022. Global Const DT_VCENTER = &H4
  1023. Global Const DT_BOTTOM = &H8
  1024. Global Const DT_WORDBREAK = &H10
  1025. Global Const DT_SINGLELINE = &H20
  1026. Global Const DT_EXPANDTABS = &H40
  1027. Global Const DT_TABSTOP = &H80
  1028. Global Const DT_NOCLIP = &H100
  1029. Global Const DT_EXTERNALLEADING = &H200
  1030. Global Const DT_CALCRECT = &H400
  1031. Global Const DT_NOPREFIX = &H800
  1032. Global Const DT_INTERNAL = &H1000
  1033.  
  1034. Declare Function DrawText Lib "GDI" (ByVal hDC As Integer, ByVal lpStr As String, ByVal nCount As Integer, lpRect As RECT, ByVal wFormat As Integer) As Integer
  1035. Declare Function DrawIcon Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal hIcon As Integer) As Integer
  1036.  
  1037. '  ExtFloodFill style flags
  1038. Global Const FLOODFILLBORDER = 0
  1039. Global Const FLOODFILLSURFACE = 1
  1040.  
  1041. Declare Function GetWindowDC Lib "GDI" (ByVal hWnd As Integer) As Integer
  1042. Declare Function GetDC Lib "GDI" (ByVal hWnd As Integer) As Integer
  1043. Declare Function ReleaseDC Lib "GDI" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer
  1044. Declare Function CreateDC Lib "GDI" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer
  1045. Declare Function CreateIC Lib "GDI" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer
  1046. Declare Function CreateCompatibleDC Lib "GDI" (ByVal hDC As Integer) As Integer
  1047. Declare Function DeleteDC Lib "GDI" (ByVal hDC As Integer) As Integer
  1048. Declare Function SaveDC Lib "GDI" (ByVal hDC As Integer) As Integer
  1049. Declare Function RestoreDC Lib "GDI" (ByVal hDC As Integer, ByVal nSavedDC As Integer) As Integer
  1050. Declare Function MoveTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1051. Declare Function GetCurrentPosition Lib "GDI" (ByVal hDC As Integer) As Long
  1052. Declare Function LineTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1053. Declare Function GetDCOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1054.  
  1055. Declare Function MulDiv Lib "GDI" (ByVal nNumber As Integer, ByVal nNumerator As Integer, ByVal nDenominator As Integer) As Integer
  1056.  
  1057. Declare Function ExtTextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal wOptions As Integer, lpRect As Any, ByVal lpString As String, ByVal nCount As Integer, lpDx As Any) As Integer
  1058.  
  1059. Declare Function Polyline Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1060. Declare Function Polygon Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1061. Declare Function PolyPolygon Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, lpPolyCounts As Integer, ByVal nCount As Integer) As Integer
  1062.  
  1063. Declare Function Rectangle Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1064. Declare Function RoundRect Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer) As Integer
  1065. Declare Function Ellipse Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1066. Declare Function Arc Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer, ByVal X4 As Integer, ByVal Y4 As Integer) As Integer
  1067. Declare Function Chord Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer, ByVal X4 As Integer, ByVal Y4 As Integer) As Integer
  1068. Declare Function Pie Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer, ByVal X4 As Integer, ByVal Y4 As Integer) As Integer
  1069. Declare Function PatBlt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal dwRop As Long) As Integer
  1070. Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  1071. Declare Function StretchBlt% Lib "GDI" (ByVal hDC%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal nSrcWidth%, ByVal nSrcHeight%, ByVal dwRop&)
  1072. Declare Function TextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal lpString As String, ByVal nCount As Integer) As Integer
  1073. Declare Function TabbedTextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal lpString As String, ByVal nCount As Integer, ByVal nTabPositions As Integer, lpnTabStopPositions As Integer, ByVal nTabOrigin As Integer) As Long
  1074. Declare Function GetCharWidth Lib "GDI" (ByVal hDC As Integer, ByVal wFirstChar As Integer, ByVal wLastChar As Integer, lpBuffer As Integer) As Integer
  1075. Declare Function SetPixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long) As Long
  1076. Declare Function GetPixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1077. Declare Function FloodFill Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long) As Integer
  1078. Declare Function ExtFloodFill Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long, ByVal wFillType As Integer) As Integer
  1079.  
  1080. Declare Function GetStockObject Lib "GDI" (ByVal nIndex As Integer) As Integer
  1081.  
  1082. Declare Function CreatePen Lib "GDI" (ByVal nPenStyle As Integer, ByVal nWidth As Integer, ByVal crColor As Long) As Integer
  1083. Declare Function CreatePenIndirect Lib "GDI" (lpLogPen As LOGPEN) As Integer
  1084.  
  1085. Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  1086. Declare Function CreateHatchBrush Lib "GDI" (ByVal nIndex As Integer, ByVal crColor As Long) As Integer
  1087. Declare Function SetBrushOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1088. Declare Function GetBrushOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1089. Declare Function CreatePatternBrush Lib "GDI" (ByVal hBitmap As Integer) As Integer
  1090. Declare Function CreateBrushIndirect Lib "GDI" (lpLogBrush As LOGBRUSH) As Integer
  1091.  
  1092. Declare Function CreateBitmap Lib "GDI" (ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal nPlanes As Integer, ByVal nBitCount As Integer, ByVal lpBits As Any) As Integer
  1093. Declare Function CreateBitmapIndirect Lib "GDI" (lpBitmap As BITMAP) As Integer
  1094. Declare Function CreateCompatibleBitmap Lib "GDI" (ByVal hDC As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
  1095. Declare Function CreateDiscardableBitmap Lib "GDI" (ByVal hDC As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
  1096.  
  1097. Declare Function SetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, ByVal lpBits As Any) As Long
  1098. Declare Function GetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, ByVal lpBits As Any) As Long
  1099. Declare Function SetBitmapDimension Lib "GDI" (ByVal hBitmap As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1100. Declare Function GetBitmapDimension Lib "GDI" (ByVal hBitmap As Integer) As Long
  1101.  
  1102. Declare Function CreateFont% Lib "GDI" (ByVal H%, ByVal W%, ByVal E%, ByVal O%, ByVal W%, ByVal I%, ByVal U%, ByVal S%, ByVal C%, ByVal OP%, ByVal CP%, ByVal Q%, ByVal PAF%, ByVal F$)
  1103. Declare Function CreateFontIndirect Lib "GDI" (lpLogFont As LOGFONT) As Integer
  1104.  
  1105. Declare Function SelectClipRgn Lib "GDI" (ByVal hDC As Integer, ByVal hRgn As Integer) As Integer
  1106. Declare Function CreateRectRgn Lib "GDI" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1107. Declare Sub SetRectRgn Lib "GDI" (ByVal hRgn As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)
  1108. Declare Function CreateRectRgnIndirect Lib "GDI" (lpRect As RECT) As Integer
  1109. Declare Function CreateEllipticRgnIndirect Lib "GDI" (lpRect As RECT) As Integer
  1110. Declare Function CreateEllipticRgn Lib "GDI" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1111. Declare Function CreatePolygonRgn Lib "GDI" (lpPoints As POINTAPI, ByVal nCount As Integer, ByVal nPolyFillMode As Integer) As Integer
  1112. Declare Function CreatePolyPolygonRgn Lib "GDI" (lpPoints As POINTAPI, lpPolyCounts As Integer, ByVal nCount As Integer, ByVal nPolyFillMode As Integer) As Integer
  1113. Declare Function CreateRoundRectRgn Lib "GDI" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer) As Integer
  1114.  
  1115. Declare Function GetObject Lib "GDI" (ByVal hObject As Integer, ByVal nCount As Integer, ByVal lpObject As Long) As Integer
  1116. Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
  1117. Declare Function SelectObject Lib "GDI" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer
  1118. Declare Function UnrealizeObject Lib "GDI" (ByVal hObject As Integer) As Integer
  1119.  
  1120. Declare Function SetBkColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  1121. Declare Function GetBkColor Lib "GDI" (ByVal hDC As Integer) As Long
  1122. Declare Function SetBkMode Lib "GDI" (ByVal hDC As Integer, ByVal nBkMode As Integer) As Integer
  1123. Declare Function GetBkMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1124. Declare Function SetTextColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  1125. Declare Function GetTextColor Lib "GDI" (ByVal hDC As Integer) As Long
  1126. Declare Function SetTextAlign Lib "GDI" (ByVal hDC As Integer, ByVal wFlags As Integer) As Integer
  1127. Declare Function GetTextAlign Lib "GDI" (ByVal hDC As Integer) As Integer
  1128. Declare Function SetMapperFlags Lib "GDI" (ByVal hDC As Integer, ByVal dwFlag As Long) As Long
  1129. Declare Function GetAspectRatioFilter Lib "GDI" (ByVal hDC As Integer) As Long
  1130. Declare Function GetNearestColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  1131. Declare Function SetROP2 Lib "GDI" (ByVal hDC As Integer, ByVal nDrawMode As Integer) As Integer
  1132. Declare Function GetROP2 Lib "GDI" (ByVal hDC As Integer) As Integer
  1133. Declare Function SetStretchBltMode Lib "GDI" (ByVal hDC As Integer, ByVal nStretchMode As Integer) As Integer
  1134. Declare Function GetStretchBltMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1135. Declare Function SetPolyFillMode Lib "GDI" (ByVal hDC As Integer, ByVal nPolyFillMode As Integer) As Integer
  1136. Declare Function GetPolyFillMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1137. Declare Function SetMapMode Lib "GDI" (ByVal hDC As Integer, ByVal nMapMode As Integer) As Integer
  1138. Declare Function GetMapMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1139. Declare Function SetWindowOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1140. Declare Function GetWindowOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1141. Declare Function SetWindowExt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1142. Declare Function GetWindowExt Lib "GDI" (ByVal hDC As Integer) As Long
  1143. Declare Function SetViewportOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1144. Declare Function GetViewportOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1145. Declare Function SetViewportExt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1146. Declare Function GetViewportExt Lib "GDI" (ByVal hDC As Integer) As Long
  1147. Declare Function OffsetViewportOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1148. Declare Function ScaleViewportExt Lib "GDI" (ByVal hDC As Integer, ByVal Xnum As Integer, ByVal Xdenom As Integer, ByVal Ynum As Integer, ByVal Ydenom As Integer) As Long
  1149. Declare Function OffsetWindowOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1150. Declare Function ScaleWindowExt Lib "GDI" (ByVal hDC As Integer, ByVal Xnum As Integer, ByVal Xdenom As Integer, ByVal Ynum As Integer, ByVal Ydenom As Integer) As Long
  1151.  
  1152. Declare Function GetClipBox Lib "GDI" (ByVal hDC As Integer, lpRect As RECT) As Integer
  1153. Declare Function IntersectClipRect Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1154. Declare Function OffsetClipRgn Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1155. Declare Function ExcludeClipRect Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1156. Declare Function PtVisible Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1157. Declare Function CombineRgn Lib "GDI" (ByVal hDestRgn As Integer, ByVal hSrcRgn1 As Integer, ByVal hSrcRgn2 As Integer, ByVal nCombineMode As Integer) As Integer
  1158. Declare Function EqualRgn Lib "GDI" (ByVal hSrcRgn1 As Integer, ByVal hSrcRgn2 As Integer) As Integer
  1159. Declare Function OffsetRgn Lib "GDI" (ByVal hRgn As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1160. Declare Function GetRgnBox Lib "GDI" (ByVal hRgn As Integer, lpRect As RECT) As Integer
  1161.  
  1162. Declare Function SetTextJustification Lib "GDI" (ByVal hDC As Integer, ByVal nBreakExtra As Integer, ByVal nBreakCount As Integer) As Integer
  1163. Declare Function GetTextExtent Lib "GDI" (ByVal hDC As Integer, ByVal lpString As String, ByVal nCount As Integer) As Long
  1164. Declare Function GetTabbedTextExtent Lib "GDI" (ByVal hDC As Integer, ByVal lpString As String, ByVal nCount As Integer, ByVal nTabPositions As Integer, lpnTabStopPositions As Integer) As Long
  1165. Declare Function SetTextCharacterExtra Lib "GDI" (ByVal hDC As Integer, ByVal nCharExtra As Integer) As Integer
  1166. Declare Function GetTextCharacterExtra Lib "GDI" (ByVal hDC As Integer) As Integer
  1167.  
  1168. Declare Function GetMetaFile Lib "GDI" (ByVal lpFilename As String) As Integer
  1169. Declare Function DeleteMetaFile Lib "GDI" (ByVal hMF As Integer) As Integer
  1170. Declare Function CopyMetaFile Lib "GDI" (ByVal hMF As Integer, ByVal lpFilename As String) As Integer
  1171.  
  1172. Declare Function PlayMetaFile Lib "GDI" (ByVal hDC As Integer, ByVal hMF As Integer) As Integer
  1173. Declare Sub PlayMetaFileRecord Lib "GDI" (ByVal hDC As Integer, lpHandletable As Integer, lpMetaRecord As METARECORD, ByVal nHandles As Integer)
  1174.  
  1175. Declare Function Escape Lib "GDI" (ByVal hDC As Integer, ByVal nEscape As Integer, ByVal nCount As Integer, lplnData As Any, lpOutData As Any) As Integer
  1176. Declare Function GetTextFace Lib "GDI" (ByVal hDC As Integer, ByVal nCount As Integer, ByVal lpFacename As String) As Integer
  1177.  
  1178. Declare Function GetTextMetrics Lib "GDI" (ByVal hDC As Integer, lpMetrics As TEXTMETRIC) As Integer
  1179.  
  1180. Declare Function GetDeviceCaps Lib "GDI" (ByVal hDC As Integer, ByVal nIndex As Integer) As Integer
  1181.  
  1182. Declare Function SetEnvironment Lib "GDI" (ByVal lpPortName As String, ByVal lpEnviron As String, ByVal nCount As Integer) As Integer
  1183. Declare Function GetEnvironment Lib "GDI" (ByVal lpPortName As String, lpEnviron As Any, ByVal nMaxCount As Integer) As Integer
  1184.  
  1185. Declare Function DPtoLP Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1186. Declare Function LPtoDP Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1187.  
  1188. Declare Function CreateMetaFile Lib "GDI" (lpString As Any) As Integer
  1189. Declare Function CloseMetaFile Lib "GDI" (ByVal hMF As Integer) As Integer
  1190. Declare Function GetMetaFileBits Lib "GDI" (ByVal hMF As Integer) As Integer
  1191. Declare Function SetMetaFileBits Lib "GDI" (ByVal hMem As Integer) As Integer
  1192.  
  1193. Declare Function SetDIBits Lib "GDI" (ByVal aHDC As Integer, ByVal hBitmap As Integer, ByVal nStartScan As Integer, ByVal nNumScans As Integer, ByVal lpBits As String, lpBI As BITMAPINFO, ByVal wUsage As Integer) As Integer
  1194.  
  1195. Declare Function GetDIBits Lib "GDI" (ByVal aHDC As Integer, ByVal hBitmap As Integer, ByVal nStartScan As Integer, ByVal nNumScans As Integer, ByVal lpBits As String, lpBI As BITMAPINFO, ByVal wUsage As Integer) As Integer
  1196.  
  1197. Declare Function SetDIBitsToDevice% Lib "GDI" (ByVal hDC#, ByVal X#, ByVal Y#, ByVal dX#, ByVal dY#, ByVal SrcX#, ByVal SrcY#, ByVal Scan#, ByVal NumScans#, ByVal Bits As String, BitsInfo As BITMAPINFO, ByVal wUsage#) 
  1198.  
  1199. Declare Function CreateDIBitmap Lib "GDI" (ByVal hDC As Integer, lpInfoHeader As BITMAPINFOHEADER, ByVal dwUsage As Long, ByVal lpInitBits As String, lpInitInfo As BITMAPINFO, ByVal wUsage As Integer) As Integer
  1200.  
  1201. Declare Function CreateDIBPatternBrush Lib "GDI" (ByVal hPackedDIB As Integer, ByVal wUsage As Integer) As Integer
  1202.  
  1203. Declare Function StretchDIBits# Lib "GDI" (ByVal hDC#, ByVal X#, ByVal Y#, ByVal dX#, ByVal dY#, ByVal SrcX#, ByVal SrcY#, ByVal wSrcWidth#, ByVal wSrcHeight#, ByVal lpBits As String, lpBitsInfo As BITMAPINFO, ByVal wUsage#, ByVal dwRop&)
  1204.  
  1205.  
  1206. Declare Function CreatePalette Lib "GDI" (lpLogPalette As LOGPALETTE) As Integer
  1207. Declare Function SelectPalette Lib "GDI" (ByVal hDC As Integer, ByVal hPalette as Integer, ByVal bForceBackground as Integer) As Integer
  1208. Declare Function RealizePalette Lib "GDI" (ByVal hDC As Integer) As Integer
  1209. Declare Function UpdateColors Lib "GDI" (ByVal hDC As Integer) As Integer
  1210. Declare Sub AnimatePalette Lib "GDI" (ByVal hPalette As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteColors As PALETTEENTRY)
  1211. Declare Function SetPaletteEntries Lib "GDI" (ByVal hPalette As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
  1212. Declare Function GetPaletteEntries Lib "GDI" (ByVal hPalette As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
  1213. Declare Function GetNearestPaletteIndex Lib "GDI" (ByVal hPalette As Integer, ByVal crColor As Long) As Integer
  1214. Declare Function ResizePalette Lib "GDI" (ByVal hPalette As Integer, ByVal nNumEntries As Integer) As Integer
  1215.  
  1216. Declare Function GetSystemPaletteEntries Lib "GDI" (ByVal hDC As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
  1217. Declare Function GetSystemPaletteUse Lib "GDI" (ByVal hDC As Integer) As Integer
  1218. Declare Function SetSystemPaletteUse Lib "GDI" (ByVal hDC As Integer, ByVal wUsage As Integer) As Integer
  1219.  
  1220.  
  1221. ' --------------------------------------------------------------------------
  1222. '     USER Section
  1223. ' --------------------------------------------------------------------------
  1224.  
  1225. Declare Function wvsprintf Lib "User" (ByVal lpOutput As String, ByVal lpFormat As String, lpArglist As Integer) As Integer
  1226.  
  1227. '  Scroll Bar Constants
  1228. Global Const SB_HORZ = 0
  1229. Global Const SB_VERT = 1
  1230. Global Const SB_CTL = 2
  1231. Global Const SB_BOTH = 3
  1232.  
  1233. '  Scroll Bar Commands
  1234. Global Const SB_LINEUP = 0
  1235. Global Const SB_LINEDOWN = 1
  1236. Global Const SB_PAGEUP = 2
  1237. Global Const SB_PAGEDOWN = 3
  1238. Global Const SB_THUMBPOSITION = 4
  1239. Global Const SB_THUMBTRACK = 5
  1240. Global Const SB_TOP = 6
  1241. Global Const SB_BOTTOM = 7
  1242. Global Const SB_ENDSCROLL = 8
  1243.  
  1244. '  ShowWindow() Commands
  1245. Global Const SW_HIDE = 0
  1246. Global Const SW_SHOWNORMAL = 1
  1247. Global Const SW_NORMAL = 1
  1248. Global Const SW_SHOWMINIMIZED = 2
  1249. Global Const SW_SHOWMAXIMIZED = 3
  1250. Global Const SW_MAXIMIZE = 3
  1251. Global Const SW_SHOWNOACTIVATE = 4
  1252. Global Const SW_SHOW = 5
  1253. Global Const SW_MINIMIZE = 6
  1254. Global Const SW_SHOWMINNOACTIVE = 7
  1255. Global Const SW_SHOWNA = 8
  1256. Global Const SW_RESTORE = 9
  1257.  
  1258. '  Old ShowWindow() Commands
  1259. Global Const HIDE_WINDOW = 0
  1260. Global Const SHOW_OPENWINDOW = 1
  1261. Global Const SHOW_ICONWINDOW = 2
  1262. Global Const SHOW_FULLSCREEN = 3
  1263. Global Const SHOW_OPENNOACTIVATE = 4
  1264.  
  1265. '  Identifiers for the WM_SHOWWINDOW message
  1266. Global Const SW_PARENTCLOSING = 1
  1267. Global Const SW_OTHERZOOM = 2
  1268. Global Const SW_PARENTOPENING = 3
  1269. Global Const SW_OTHERUNZOOM = 4
  1270.  
  1271. '  Region Flags
  1272. Global Const ERRORAPI = 0
  1273. Global Const NULLREGION = 1
  1274. Global Const SIMPLEREGION = 2
  1275. Global Const COMPLEXREGION = 3
  1276.  
  1277. '  CombineRgn() Styles
  1278. Global Const RGN_AND = 1
  1279. Global Const RGN_OR = 2
  1280. Global Const RGN_XOR = 3
  1281. Global Const RGN_DIFF = 4
  1282. Global Const RGN_COPY = 5
  1283.  
  1284. '  Virtual Keys, Standard Set
  1285. Global Const VK_LBUTTON = &H1
  1286. Global Const VK_RBUTTON = &H2
  1287. Global Const VK_CANCEL = &H3
  1288. Global Const VK_MBUTTON = &H4    '  NOT contiguous with L & RBUTTON
  1289. Global Const VK_BACK = &H8
  1290. Global Const VK_TAB = &H9
  1291. Global Const VK_CLEAR = &HC
  1292. Global Const VK_RETURN = &HD
  1293. Global Const VK_SHIFT = &H10
  1294. Global Const VK_CONTROL = &H11
  1295. Global Const VK_MENU = &H12
  1296. Global Const VK_PAUSE = &H13
  1297. Global Const VK_CAPITAL = &H14
  1298. Global Const VK_ESCAPE = &H1B
  1299. Global Const VK_SPACE = &H20
  1300. Global Const VK_PRIOR = &H21
  1301. Global Const VK_NEXT = &H22
  1302. Global Const VK_END = &H23
  1303. Global Const VK_HOME = &H24
  1304. Global Const VK_LEFT = &H25
  1305. Global Const VK_UP = &H26
  1306. Global Const VK_RIGHT = &H27
  1307. Global Const VK_DOWN = &H28
  1308. Global Const VK_SELECT = &H29
  1309. Global Const VK_PRINT = &H2A
  1310. Global Const VK_EXECUTE = &H2B
  1311. Global Const VK_SNAPSHOT = &H2C
  1312. 'Global Const VK_COPY = &H2C     not used by keyboards.
  1313. Global Const VK_INSERT = &H2D
  1314. Global Const VK_DELETE = &H2E
  1315. Global Const VK_HELP = &H2F
  1316.  
  1317. '  VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  1318. '  VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0'
  1319.  
  1320. Global Const VK_NUMPAD0 = &H60
  1321. Global Const VK_NUMPAD1 = &H61
  1322. Global Const VK_NUMPAD2 = &H62
  1323. Global Const VK_NUMPAD3 = &H63
  1324. Global Const VK_NUMPAD4 = &H64
  1325. Global Const VK_NUMPAD5 = &H65
  1326. Global Const VK_NUMPAD6 = &H66
  1327. Global Const VK_NUMPAD7 = &H67
  1328. Global Const VK_NUMPAD8 = &H68
  1329. Global Const VK_NUMPAD9 = &H69
  1330. Global Const VK_MULTIPLY = &H6A
  1331. Global Const VK_ADD = &H6B
  1332. Global Const VK_SEPARATOR = &H6C
  1333. Global Const VK_SUBTRACT = &H6D
  1334. Global Const VK_DECIMAL = &H6E
  1335. Global Const VK_DIVIDE = &H6F
  1336. Global Const VK_F1 = &H70
  1337. Global Const VK_F2 = &H71
  1338. Global Const VK_F3 = &H72
  1339. Global Const VK_F4 = &H73
  1340. Global Const VK_F5 = &H74
  1341. Global Const VK_F6 = &H75
  1342. Global Const VK_F7 = &H76
  1343. Global Const VK_F8 = &H77
  1344. Global Const VK_F9 = &H78
  1345. Global Const VK_F10 = &H79
  1346. Global Const VK_F11 = &H7A
  1347. Global Const VK_F12 = &H7B
  1348. Global Const VK_F13 = &H7C
  1349. Global Const VK_F14 = &H7D
  1350. Global Const VK_F15 = &H7E
  1351. Global Const VK_F16 = &H7F
  1352.  
  1353. Global Const VK_NUMLOCK = &H90
  1354.  
  1355. '  SetWindowsHook() codes
  1356. Global Const WH_MSGFILTER = (-1)
  1357. Global Const WH_JOURNALRECORD = 0
  1358. Global Const WH_JOURNALPLAYBACK = 1
  1359. Global Const WH_KEYBOARD = 2
  1360. Global Const WH_GETMESSAGE = 3
  1361. Global Const WH_CALLWNDPROC = 4
  1362. Global Const WH_CBT = 5
  1363. Global Const WH_SYSMSGFILTER = 6
  1364. Global Const WH_WINDOWMGR = 7
  1365.  
  1366. '  Hook Codes
  1367. Global Const HC_LPLPFNNEXT = (-2)
  1368. Global Const HC_LPFNNEXT = (-1)
  1369. Global Const HC_ACTION = 0
  1370. Global Const HC_GETNEXT = 1
  1371. Global Const HC_SKIP = 2
  1372. Global Const HC_NOREM = 3
  1373. Global Const HC_NOREMOVE = 3
  1374. Global Const HC_SYSMODALON = 4
  1375. Global Const HC_SYSMODALOFF = 5
  1376.  
  1377. '  CBT Hook Codes
  1378. Global Const HCBT_MOVESIZE = 0
  1379. Global Const HCBT_MINMAX = 1
  1380. Global Const HCBT_QS = 2
  1381.  
  1382. '  WH_MSGFILTER Filter Proc Codes
  1383. Global Const MSGF_DIALOGBOX = 0
  1384. Global Const MSGF_MESSAGEBOX = 1
  1385. Global Const MSGF_MENU = 2
  1386. Global Const MSGF_MOVE = 3
  1387. Global Const MSGF_SIZE = 4
  1388. Global Const MSGF_SCROLLBAR = 5
  1389. Global Const MSGF_NEXTWINDOW = 6
  1390.  
  1391. '  Window Manager Hook Codes
  1392. Global Const WC_INIT = 1
  1393. Global Const WC_SWP = 2
  1394. Global Const WC_DEFWINDOWPROC = 3
  1395. Global Const WC_MINMAX = 4
  1396. Global Const WC_MOVE = 5
  1397. Global Const WC_SIZE = 6
  1398. Global Const WC_DRAWCAPTION = 7
  1399.  
  1400. '  Message Structure used in Journaling
  1401. Type EVENTMSG
  1402.     message As Integer
  1403.     paramL As Integer
  1404.     paramH As Integer
  1405.     time As Long
  1406. End Type
  1407.  
  1408. '  Message structure
  1409. Type MSG
  1410.     hwnd As Integer
  1411.     message As Integer
  1412.     wParam As Integer
  1413.     lParam As Long
  1414.     time As Long
  1415.     pt As POINTAPI
  1416. End Type
  1417.  
  1418.  
  1419. '  Window field offsets for GetWindowLong() and GetWindowWord()
  1420. Global Const GWL_WNDPROC = (-4)
  1421. Global Const GWW_HINSTANCE = (-6)
  1422. Global Const GWW_HWNDPARENT = (-8)
  1423. Global Const GWW_ID = (-12)
  1424. Global Const GWL_STYLE = (-16)
  1425. Global Const GWL_EXSTYLE = (-20)
  1426.  
  1427. '  Class field offsets for GetClassLong() and GetClassWord()
  1428. Global Const GCL_MENUNAME = (-8)
  1429. Global Const GCW_HBRBACKGROUND = (-10)
  1430. Global Const GCW_HCURSOR = (-12)
  1431. Global Const GCW_HICON = (-14)
  1432. Global Const GCW_HMODULE = (-16)
  1433. Global Const GCW_CBWNDEXTRA = (-18)
  1434. Global Const GCW_CBCLSEXTRA = (-20)
  1435. Global Const GCL_WNDPROC = (-24)
  1436. Global Const GCW_STYLE = (-26)
  1437.  
  1438. '  Window Messages
  1439. Global Const WM_NULL = &H0
  1440. Global Const WM_CREATE = &H1
  1441. Global Const WM_DESTROY = &H2
  1442. Global Const WM_MOVE = &H3
  1443. Global Const WM_SIZE = &H5
  1444. Global Const WM_ACTIVATE = &H6
  1445. Global Const WM_SETFOCUS = &H7
  1446. Global Const WM_KILLFOCUS = &H8
  1447. Global Const WM_ENABLE = &HA
  1448. Global Const WM_SETREDRAW = &HB
  1449. Global Const WM_SETTEXT = &HC
  1450. Global Const WM_GETTEXT = &HD
  1451. Global Const WM_GETTEXTLENGTH = &HE
  1452. Global Const WM_PAINT = &HF
  1453. Global Const WM_CLOSE = &H10
  1454. Global Const WM_QUERYENDSESSION = &H11
  1455. Global Const WM_QUIT = &H12
  1456. Global Const WM_QUERYOPEN = &H13
  1457. Global Const WM_ERASEBKGND = &H14
  1458. Global Const WM_SYSCOLORCHANGE = &H15
  1459. Global Const WM_ENDSESSION = &H16
  1460. Global Const WM_SHOWWINDOW = &H18
  1461. Global Const WM_CTLCOLOR = &H19
  1462. Global Const WM_WININICHANGE = &H1A
  1463. Global Const WM_DEVMODECHANGE = &H1B
  1464. Global Const WM_ACTIVATEAPP = &H1C
  1465. Global Const WM_FONTCHANGE = &H1D
  1466. Global Const WM_TIMECHANGE = &H1E
  1467. Global Const WM_CANCELMODE = &H1F
  1468. Global Const WM_SETCURSOR = &H20
  1469. Global Const WM_MOUSEACTIVATE = &H21
  1470. Global Const WM_CHILDACTIVATE = &H22
  1471. Global Const WM_QUEUESYNC = &H23
  1472. Global Const WM_GETMINMAXINFO = &H24
  1473. Global Const WM_PAINTICON = &H26
  1474. Global Const WM_ICONERASEBKGND = &H27
  1475. Global Const WM_NEXTDLGCTL = &H28
  1476. Global Const WM_SPOOLERSTATUS = &H2A
  1477. Global Const WM_DRAWITEM = &H2B
  1478. Global Const WM_MEASUREITEM = &H2C
  1479. Global Const WM_DELETEITEM = &H2D
  1480. Global Const WM_VKEYTOITEM = &H2E
  1481. Global Const WM_CHARTOITEM = &H2F
  1482. Global Const WM_SETFONT = &H30
  1483. Global Const WM_GETFONT = &H31
  1484.  
  1485. Global Const WM_QUERYDRAGICON = &H37
  1486.  
  1487. Global Const WM_COMPAREITEM = &H39
  1488. Global Const WM_COMPACTING = &H41
  1489.  
  1490. Global Const WM_NCCREATE = &H81
  1491. Global Const WM_NCDESTROY = &H82
  1492. Global Const WM_NCCALCSIZE = &H83
  1493. Global Const WM_NCHITTEST = &H84
  1494. Global Const WM_NCPAINT = &H85
  1495. Global Const WM_NCACTIVATE = &H86
  1496. Global Const WM_GETDLGCODE = &H87
  1497. Global Const WM_NCMOUSEMOVE = &HA0
  1498. Global Const WM_NCLBUTTONDOWN = &HA1
  1499. Global Const WM_NCLBUTTONUP = &HA2
  1500. Global Const WM_NCLBUTTONDBLCLK = &HA3
  1501. Global Const WM_NCRBUTTONDOWN = &HA4
  1502. Global Const WM_NCRBUTTONUP = &HA5
  1503. Global Const WM_NCRBUTTONDBLCLK = &HA6
  1504. Global Const WM_NCMBUTTONDOWN = &HA7
  1505. Global Const WM_NCMBUTTONUP = &HA8
  1506. Global Const WM_NCMBUTTONDBLCLK = &HA9
  1507.  
  1508. Global Const WM_KEYFIRST = &H100
  1509. Global Const WM_KEYDOWN = &H100
  1510. Global Const WM_KEYUP = &H101
  1511. Global Const WM_CHAR = &H102
  1512. Global Const WM_DEADCHAR = &H103
  1513. Global Const WM_SYSKEYDOWN = &H104
  1514. Global Const WM_SYSKEYUP = &H105
  1515. Global Const WM_SYSCHAR = &H106
  1516. Global Const WM_SYSDEADCHAR = &H107
  1517. Global Const WM_KEYLAST = &H108
  1518.  
  1519. Global Const WM_INITDIALOG = &H110
  1520. Global Const WM_COMMAND = &H111
  1521. Global Const WM_SYSCOMMAND = &H112
  1522. Global Const WM_TIMER = &H113
  1523. Global Const WM_HSCROLL = &H114
  1524. Global Const WM_VSCROLL = &H115
  1525. Global Const WM_INITMENU = &H116
  1526. Global Const WM_INITMENUPOPUP = &H117
  1527. Global Const WM_MENUSELECT = &H11F
  1528. Global Const WM_MENUCHAR = &H120
  1529. Global Const WM_ENTERIDLE = &H121
  1530.  
  1531. Global Const WM_MOUSEFIRST = &H200
  1532. Global Const WM_MOUSEMOVE = &H200
  1533. Global Const WM_LBUTTONDOWN = &H201
  1534. Global Const WM_LBUTTONUP = &H202
  1535. Global Const WM_LBUTTONDBLCLK = &H203
  1536. Global Const WM_RBUTTONDOWN = &H204
  1537. Global Const WM_RBUTTONUP = &H205
  1538. Global Const WM_RBUTTONDBLCLK = &H206
  1539. Global Const WM_MBUTTONDOWN = &H207
  1540. Global Const WM_MBUTTONUP = &H208
  1541. Global Const WM_MBUTTONDBLCLK = &H209
  1542. Global Const WM_MOUSELAST = &H209
  1543.  
  1544. Global Const WM_PARENTNOTIFY = &H210
  1545. Global Const WM_MDICREATE = &H220
  1546. Global Const WM_MDIDESTROY = &H221
  1547. Global Const WM_MDIACTIVATE = &H222
  1548. Global Const WM_MDIRESTORE = &H223
  1549. Global Const WM_MDINEXT = &H224
  1550. Global Const WM_MDIMAXIMIZE = &H225
  1551. Global Const WM_MDITILE = &H226
  1552. Global Const WM_MDICASCADE = &H227
  1553. Global Const WM_MDIICONARRANGE = &H228
  1554. Global Const WM_MDIGETACTIVE = &H229
  1555. Global Const WM_MDISETMENU = &H230
  1556.  
  1557. Global Const WM_CUT = &H300
  1558. Global Const WM_COPY = &H301
  1559. Global Const WM_PASTE = &H302
  1560. Global Const WM_CLEAR = &H303
  1561. Global Const WM_UNDO = &H304
  1562. Global Const WM_RENDERFORMAT = &H305
  1563. Global Const WM_RENDERALLFORMATS = &H306
  1564. Global Const WM_DESTROYCLIPBOARD = &H307
  1565. Global Const WM_DRAWCLIPBOARD = &H308
  1566. Global Const WM_PAINTCLIPBOARD = &H309
  1567. Global Const WM_VSCROLLCLIPBOARD = &H30A
  1568. Global Const WM_SIZECLIPBOARD = &H30B
  1569. Global Const WM_ASKCBFORMATNAME = &H30C
  1570. Global Const WM_CHANGECBCHAIN = &H30D
  1571. Global Const WM_HSCROLLCLIPBOARD = &H30E
  1572. Global Const WM_QUERYNEWPALETTE = &H30F
  1573. Global Const WM_PALETTEISCHANGING = &H310
  1574. Global Const WM_PALETTECHANGED = &H311
  1575.  
  1576. '  NOTE: All Message Numbers below 0x0400 are RESERVED.
  1577.  
  1578. '  Private Window Messages Start Here:
  1579. Global Const WM_USER = &H400
  1580.  
  1581. '  WM_SYNCTASK Commands
  1582. Global Const ST_BEGINSWP = 0
  1583. Global Const ST_ENDSWP = 1
  1584.  
  1585. '  WinWhere() Area Codes
  1586. Global Const HTERROR = (-2)
  1587. Global Const HTTRANSPARENT = (-1)
  1588. Global Const HTNOWHERE = 0
  1589. Global Const HTCLIENT = 1
  1590. Global Const HTCAPTION = 2
  1591. Global Const HTSYSMENU = 3
  1592. Global Const HTGROWBOX = 4
  1593. Global Const HTSIZE = HTGROWBOX
  1594. Global Const HTMENU = 5
  1595. Global Const HTHSCROLL = 6
  1596. Global Const HTVSCROLL = 7
  1597. Global Const HTREDUCE = 8
  1598. Global Const HTZOOM = 9
  1599. Global Const HTLEFT = 10
  1600. Global Const HTRIGHT = 11
  1601. Global Const HTTOP = 12
  1602. Global Const HTTOPLEFT = 13
  1603. Global Const HTTOPRIGHT = 14
  1604. Global Const HTBOTTOM = 15
  1605. Global Const HTBOTTOMLEFT = 16
  1606. Global Const HTBOTTOMRIGHT = 17
  1607. Global Const HTSIZEFIRST = HTLEFT
  1608. Global Const HTSIZELAST = HTBOTTOMRIGHT
  1609.  
  1610. '  WM_MOUSEACTIVATE Return Codes
  1611. Global Const MA_ACTIVATE = 1
  1612. Global Const MA_ACTIVATEANDEAT = 2
  1613. Global Const MA_NOACTIVATE = 3
  1614.  
  1615. Declare Function RegisterWindowMessage Lib "User" (ByVal lpString As String) As Integer
  1616.  
  1617. '  Size Message Commands
  1618. Global Const SIZENORMAL = 0
  1619. Global Const SIZEICONIC = 1
  1620. Global Const SIZEFULLSCREEN = 2
  1621. Global Const SIZEZOOMSHOW = 3
  1622. Global Const SIZEZOOMHIDE = 4
  1623.  
  1624. '  Key State Masks for Mouse Messages
  1625. Global Const MK_LBUTTON = &H1
  1626. Global Const MK_RBUTTON = &H2
  1627. Global Const MK_SHIFT = &H4
  1628. Global Const MK_CONTROL = &H8
  1629. Global Const MK_MBUTTON = &H10
  1630.  
  1631. '  Window Styles
  1632. Global Const WS_OVERLAPPED = &H00000&
  1633. Global Const WS_POPUP = &H80000000&
  1634. Global Const WS_CHILD = &H40000000&
  1635. Global Const WS_MINIMIZE = &H20000000&
  1636. Global Const WS_VISIBLE = &H10000000&
  1637. Global Const WS_DISABLED = &H8000000&
  1638. Global Const WS_CLIPSIBLINGS = &H4000000&
  1639. Global Const WS_CLIPCHILDREN = &H2000000&
  1640. Global Const WS_MAXIMIZE = &H1000000&
  1641. Global Const WS_CAPTION = &HC00000&    '  WS_BORDER Or WS_DLGFRAME
  1642. Global Const WS_BORDER = &H800000&
  1643. Global Const WS_DLGFRAME = &H400000&
  1644. Global Const WS_VSCROLL = &H200000&
  1645. Global Const WS_HSCROLL = &H100000&
  1646. Global Const WS_SYSMENU = &H80000&
  1647. Global Const WS_THICKFRAME = &H40000&
  1648. Global Const WS_GROUP = &H20000&
  1649. Global Const WS_TABSTOP = &H10000&
  1650.  
  1651. Global Const WS_MINIMIZEBOX = &H20000&
  1652. Global Const WS_MAXIMIZEBOX = &H10000&
  1653.  
  1654. Global Const WS_TILED = WS_OVERLAPPED
  1655. Global Const WS_ICONIC = WS_MINIMIZE
  1656. Global Const WS_SIZEBOX = WS_THICKFRAME
  1657.  
  1658. '  Common Window Styles
  1659. Global Const WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
  1660. Global Const WS_POPUPWINDOW = (WS_POPUP Or WS_BORDER Or WS_SYSMENU)
  1661. Global Const WS_CHILDWINDOW = (WS_CHILD)
  1662. Global Const WS_TILEDWINDOW = (WS_OVERLAPPEDWINDOW)
  1663.  
  1664. '  Extended Window Styles
  1665. Global Const WS_EX_DLGMODALFRAME = &H00001&
  1666. Global Const WS_EX_NOPARENTNOTIFY = &H00004&
  1667.  
  1668. '  Class styles
  1669. Global Const CS_VREDRAW = &H1
  1670. Global Const CS_HREDRAW = &H2
  1671. Global Const CS_KEYCVTWINDOW = &H4
  1672. Global Const CS_DBLCLKS = &H8
  1673. Global Const CS_OWNDC = &H20
  1674. Global Const CS_CLASSDC = &H40
  1675. Global Const CS_PARENTDC = &H80
  1676. Global Const CS_NOKEYCVT = &H100
  1677. Global Const CS_NOCLOSE = &H200
  1678. Global Const CS_SAVEBITS = &H800
  1679. Global Const CS_BYTEALIGNCLIENT = &H1000
  1680. Global Const CS_BYTEALIGNWINDOW = &H2000
  1681. Global Const CS_GLOBALCLASS = &H4000    '  Global window class
  1682.  
  1683. '  Predefined Clipboard Formats
  1684. Global Const CF_TEXT = 1
  1685. Global Const CF_BITMAP = 2
  1686. Global Const CF_METAFILEPICT = 3
  1687. Global Const CF_SYLK = 4
  1688. Global Const CF_DIF = 5
  1689. Global Const CF_TIFF = 6
  1690. Global Const CF_OEMTEXT = 7
  1691. Global Const CF_DIB = 8
  1692. Global Const CF_PALETTE = 9
  1693.  
  1694. Global Const CF_OWNERDISPLAY = &H80
  1695. Global Const CF_DSPTEXT = &H81
  1696. Global Const CF_DSPBITMAP = &H82
  1697. Global Const CF_DSPMETAFILEPICT = &H83
  1698.  
  1699. '  "Private" formats don't get GlobalFree()'d
  1700. Global Const CF_PRIVATEFIRST = &H200
  1701. Global Const CF_PRIVATELAST = &H2FF
  1702.  
  1703. '  "GDIOBJ" formats do get DeleteObject()'d
  1704. Global Const CF_GDIOBJFIRST = &H300
  1705. Global Const CF_GDIOBJLAST = &H3FF
  1706.  
  1707. Type PAINTSTRUCT
  1708.     hdc As Integer
  1709.     fErase As Integer
  1710.     rcPaint As RECT
  1711.     fRestore As Integer
  1712.     fIncUpdate As Integer
  1713.     rgbReserved As String * 16
  1714. End Type
  1715.  
  1716. Type CREATESTRUCT
  1717.     lpCreateParams As Long
  1718.     hInstance As Integer
  1719.     hMenu As Integer
  1720.     hwndParent As Integer
  1721.     cy As Integer
  1722.     cx As Integer
  1723.     y As Integer
  1724.     x As Integer
  1725.     style As Long
  1726.     lpszName As Long
  1727.     lpszClass As Long
  1728.     ExStyle As Long
  1729. End Type
  1730.  
  1731. '  Owner draw control types
  1732. Global Const ODT_MENU = 1
  1733. Global Const ODT_LISTBOX = 2
  1734. Global Const ODT_COMBOBOX = 3
  1735. Global Const ODT_BUTTON = 4
  1736.  
  1737. '  Owner draw actions
  1738. Global Const ODA_DRAWENTIRE = &H1
  1739. Global Const ODA_SELECT = &H2
  1740. Global Const ODA_FOCUS = &H4
  1741.  
  1742. '  Owner draw state
  1743. Global Const ODS_SELECTED = &H1
  1744. Global Const ODS_GRAYED = &H2
  1745. Global Const ODS_DISABLED = &H4
  1746. Global Const ODS_CHECKED = &H8
  1747. Global Const ODS_FOCUS = &H10
  1748.  
  1749. '  MEASUREITEMSTRUCT for ownerdraw
  1750. Type MEASUREITEMSTRUCT
  1751.     CtlType As Integer
  1752.     CtlID As Integer
  1753.     itemID As Integer
  1754.     itemWidth As Integer
  1755.     itemHeight As Integer
  1756.     itemData As Long
  1757. End Type
  1758.  
  1759. '  DRAWITEMSTRUCT for ownerdraw
  1760. Type DRAWITEMSTRUCT
  1761.     CtlType As Integer
  1762.     CtlID As Integer
  1763.     itemID As Integer
  1764.     itemAction As Integer
  1765.     itemState As Integer
  1766.     hwndItem As Integer
  1767.     hDC As Integer
  1768.     rcItem As RECT
  1769.     itemData As Long
  1770. End Type
  1771.  
  1772. '  DELETEITEMSTRUCT for ownerdraw
  1773. Type DELETEITEMSTRUCT
  1774.     CtlType As Integer
  1775.     CtlID As Integer
  1776.     itemID As Integer
  1777.     hwndItem As Integer
  1778.     itemData As Long
  1779. End Type
  1780.  
  1781. '  COMPAREITEMSTRUCT for ownerdraw sorting
  1782. Type COMPAREITEMSTRUCT
  1783.     CtlType As Integer
  1784.     CtlID As Integer
  1785.     hwndItem As Integer
  1786.     itemID1 As Integer
  1787.     itemData1 As Long
  1788.     itemID2 As Integer
  1789.     itemData2 As Long
  1790. End Type
  1791.  
  1792. '  Message Function Templates
  1793. Declare Function GetMessage Lib "User" (lpMsg As MSG, ByVal hWnd As Integer, ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer) As Integer
  1794. Declare Function TranslateMessage Lib "User" (lpMsg As MSG) As Integer
  1795. Declare Function DispatchMessage Lib "User" (lpMsg As MSG) As Long
  1796. Declare Function PeekMessage Lib "User" (lpMsg As MSG, ByVal hWnd As Integer, ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer, ByVal wRemoveMsg As Integer) As Integer
  1797.  
  1798. '  PeekMessage() Options
  1799. Global Const PM_NOREMOVE = &H0
  1800. Global Const PM_REMOVE = &H1
  1801. Global Const PM_NOYIELD = &H2
  1802.  
  1803. Declare Function lstrcmp Lib "User" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Integer
  1804. Declare Function lstrcmpi Lib "User" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Integer
  1805. Declare Function lstrcpy Lib "Kernel" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
  1806. Declare Function lstrcat Lib "Kernel" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
  1807. Declare Function lstrlen Lib "Kernel" (ByVal lpString As Any) As Integer
  1808.  
  1809. Declare Function lopen Lib "Kernel" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Integer) As Integer
  1810. Declare Function lclose Lib "Kernel" Alias "_lclose" (ByVal hFile As Integer) As Integer
  1811. Declare Function lcreat Lib "Kernel" Alias "_lcreat" (ByVal lpPathName As String, ByVal iAttribute As Integer) As Integer
  1812. Declare Function llseek Lib "Kernel" Alias "_llseek" (ByVal hFile As Integer, ByVal lOffset As Long, ByVal iOrigin As Integer) As Long
  1813. Declare Function lread Lib "Kernel" Alias "_lread" (ByVal hFile As Integer, ByVal lpBuffer As String, ByVal wBytes As Integer) As Integer
  1814. Declare Function lwrite Lib "Kernel" Alias "_lwrite" (ByVal hFile As Integer, ByVal lpBuffer As String, ByVal wBytes As Integer) As Integer
  1815.  
  1816. Global Const READAPI = 0    '  Flags for _lopen
  1817. Global Const WRITEAPI = 1
  1818. Global Const READ_WRITE = 2
  1819.  
  1820. Declare Function ExitWindows Lib "User" (ByVal dwReserved As Long, wReturnCode) As Integer
  1821.  
  1822. Declare Function SwapMouseButton Lib "User" (ByVal bSwap As Integer) As Integer
  1823. Declare Function GetMessagePos Lib "User" () As Long
  1824. Declare Function GetMessageTime Lib "User" () As Long
  1825.  
  1826. Declare Function GetSysModalWindow Lib "User" () As Integer
  1827. Declare Function SetSysModalWindow Lib "User" (ByVal hWnd As Integer) As Integer
  1828.  
  1829. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1830. Declare Function PostMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Integer
  1831. Declare Function PostAppMessage Lib "User" (ByVal hTask As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Integer
  1832. Declare Sub ReplyMessage Lib "User" (ByVal lReply As Long)
  1833. Declare Sub WaitMessage Lib "User" ()
  1834. Declare Function DefWindowProc Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1835. Declare Sub PostQuitMessage Lib "User" (ByVal nExitCode As Integer)
  1836. Declare Function InSendMessage Lib "User" () As Integer
  1837.  
  1838. Declare Function GetDoubleClickTime Lib "User" () As Integer
  1839. Declare Sub SetDoubleClickTime Lib "User" (ByVal wCount As Integer)
  1840.  
  1841. Declare Function UnregisterClass Lib "User" (ByVal lpClassName As String, ByVal hInstance As Integer) As Integer
  1842.  
  1843. Declare Function SetMessageQueue Lib "User" (ByVal cMsg As Integer) As Integer
  1844.  
  1845. Global Const CW_USEDEFAULT = &H8000
  1846.  
  1847. Declare Function CreateWindow% Lib "User" (ByVal lpClassName$, ByVal lpWindowName$, ByVal dwStyle&, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hWndParent%, ByVal hMenu%, ByVal hInstance%, ByVal lpParam$)
  1848. Declare Function CreateWindowEx% Lib "User" (ByVal dwExStyle&, ByVal lpClassName$, ByVal lpWindowName$, ByVal dwStyle&, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hWndParent%, ByVal hMenu%, ByVal hInstance%, ByVal lpParam$)
  1849. Declare Function IsWindow Lib "User" (ByVal hWnd As Integer) As Integer
  1850. Declare Function IsChild Lib "User" (ByVal hWndParent As Integer, ByVal hWnd As Integer) As Integer
  1851. Declare Function DestroyWindow Lib "User" (ByVal hWnd As Integer) As Integer
  1852.  
  1853. Declare Function ShowWindow Lib "User" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer
  1854. Declare Function FlashWindow Lib "User" (ByVal hWnd As Integer, ByVal bInvert As Integer) As Integer
  1855. Declare Sub ShowOwnedPopups Lib "User" (ByVal hWnd As Integer, ByVal fShow As Integer)
  1856.  
  1857. Declare Function OpenIcon Lib "User" (ByVal hWnd As Integer) As Integer
  1858. Declare Sub CloseWindow Lib "User" (ByVal hWnd As Integer)
  1859. Declare Sub MoveWindow Lib "User" (ByVal hWnd As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Integer)
  1860. Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
  1861.  
  1862. Declare Function BeginDeferWindowPos Lib "User" (ByVal nNumWindows As Integer)
  1863. Declare Function DeferWindowPos Lib "User" (ByVal hWinPosInfo As Integer, ByVal hWnd as Integer, ByVal hWndInsertAfter as Integer, ByVal x, ByVal y, ByVal cx, ByVal cy, ByVal wFlags as Integer)
  1864. Declare Sub EndDeferWindowPos Lib "User" (ByVal hWinPosInfo As Integer)
  1865.  
  1866. Declare Function IsWindowVisible Lib "User" (ByVal hWnd As Integer) As Integer
  1867. Declare Function IsIconic Lib "User" (ByVal hWnd As Integer) As Integer
  1868. Declare Function AnyPopup Lib "User" () As Integer
  1869. Declare Sub BringWindowToTop Lib "User" (ByVal hWnd As Integer)
  1870. Declare Function IsZoomed Lib "User" (ByVal hWnd As Integer) As Integer
  1871.  
  1872. '  SetWindowPos Flags
  1873. Global Const SWP_NOSIZE = &H1
  1874. Global Const SWP_NOMOVE = &H2
  1875. Global Const SWP_NOZORDER = &H4
  1876. Global Const SWP_NOREDRAW = &H8
  1877. Global Const SWP_NOACTIVATE = &H10
  1878. Global Const SWP_DRAWFRAME = &H20
  1879. Global Const SWP_SHOWWINDOW = &H40
  1880. Global Const SWP_HIDEWINDOW = &H80
  1881. Global Const SWP_NOCOPYBITS = &H100
  1882. Global Const SWP_NOREPOSITION = &H200
  1883.  
  1884. Declare Sub EndDialog Lib "User" (ByVal hDlg As Integer, ByVal nResult As Integer)
  1885. Declare Function GetDlgItem Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer) As Integer
  1886. Declare Sub SetDlgItemInt Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal wValue As Integer, ByVal bSigned As Integer)
  1887. Declare Function GetDlgItemInt Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, lpTranslated As Integer, ByVal bSigned As Integer) As Integer
  1888. Declare Sub SetDlgItemText Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal lpString As String)
  1889. Declare Function GetDlgItemText Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal lpString As String, ByVal nMaxCount As Integer) As Integer
  1890. Declare Sub CheckDlgButton Lib "User" (ByVal hDlg As Integer, ByVal nIDButton As Integer, ByVal wCheck As Integer)
  1891. Declare Sub CheckRadioButton Lib "User" (ByVal hDlg As Integer, ByVal nIDFirstButton As Integer, ByVal nIDLastButton As Integer, ByVal nIDCheckButton As Integer)
  1892. Declare Function IsDlgButtonChecked Lib "User" (ByVal hDlg As Integer, ByVal nIDButton As Integer) As Integer
  1893. Declare Function SendDlgItemMessage Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1894. Declare Function GetNextDlgGroupItem Lib "User" (ByVal hDlg As Integer, ByVal hCtl As Integer, ByVal bPrevious As Integer) As Integer
  1895. Declare Function GetNextDlgTabItem Lib "User" (ByVal hDlg As Integer, ByVal hCtl As Integer, ByVal bPrevious As Integer) As Integer
  1896. Declare Function GetDlgCtrlID Lib "User" (ByVal hWnd As Integer) As Integer
  1897. Declare Function GetDialogBaseUnits Lib "User" () As Long
  1898. Declare Function DefDlgProc Lib "User" (ByVal hDlg As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1899.  
  1900. Global Const DLGWINDOWEXTRA = 30    '  Window extra bytes needed for private dialog classes
  1901.  
  1902. Declare Function CallMsgFilter Lib "User" (lpMsg As MSG, ByVal nCode As Integer) As Integer
  1903.  
  1904. '  Clipboard Manager Functions
  1905. Declare Function OpenClipboard Lib "User" (ByVal hWnd As Integer) As Integer
  1906. Declare Function CloseClipboard Lib "User" () As Integer
  1907. Declare Function GetClipboardOwner Lib "User" () As Integer
  1908. Declare Function SetClipboardViewer Lib "User" (ByVal hWnd As Integer) As Integer
  1909. Declare Function GetClipboardViewer Lib "User" () As Integer
  1910. Declare Function ChangeClipboardChain Lib "User" (ByVal hWnd As Integer, ByVal hWndNext As Integer) As Integer
  1911. Declare Function SetClipboardData Lib "User" (ByVal wFormat As Integer, ByVal hMem As Integer) As Integer
  1912. Declare Function GetClipboardData Lib "User" (ByVal wFormat As Integer) As Integer
  1913. Declare Function RegisterClipboardFormat Lib "User" (ByVal lpString As String) As Integer
  1914. Declare Function CountClipboardFormats Lib "User" () As Integer
  1915. Declare Function EnumClipboardFormats Lib "User" (ByVal wFormat As Integer) As Integer
  1916. Declare Function GetClipboardFormatName Lib "User" (ByVal wFormat As Integer, ByVal lpString As String, ByVal nMaxCount As Integer) As Integer
  1917. Declare Function EmptyClipboard Lib "User" () As Integer
  1918. Declare Function IsClipboardFormatAvailable Lib "User" (ByVal wFormat As Integer) As Integer
  1919. Declare Function GetPriorityClipboardFormat Lib "User" (lpPriorityList As Integer, ByVal nCount As Integer) As Integer
  1920.  
  1921. Declare Function SetFocusAPI Lib "User" Alias "SetFocus" (ByVal hWnd As Integer) As Integer
  1922. Declare Function GetFocus Lib "User" () As Integer
  1923. Declare Function GetActiveWindow Lib "User" () As Integer
  1924. Declare Function GetKeyState Lib "User" (ByVal nVirtKey As Integer) As Integer
  1925. Declare Function GetAsyncKeyState Lib "User" (ByVal vKey As Integer) As Integer
  1926. Declare Sub GetKeyboardState Lib "User" (LpKeyState As Any)
  1927. Declare Sub SetKeyboardState Lib "User" (lpKeyState As Any)
  1928. Declare Function EnableHardwareInput Lib "User" (ByVal bEnableInput As Integer) As Integer
  1929. Declare Function GetInputState Lib "User" () As Integer
  1930. Declare Function GetCapture Lib "User" () As Integer
  1931. Declare Function SetCapture Lib "User" (ByVal hWnd As Integer) As Integer
  1932. Declare Sub ReleaseCapture Lib "User" ()
  1933.  
  1934. '  Windows Functions
  1935. Declare Function KillTimer Lib "User" (ByVal hWnd As Integer, ByVal nIDEvent As Integer) As Integer
  1936.  
  1937. Declare Function EnableWindow Lib "User" (ByVal hWnd As Integer, ByVal aBOOL As Integer) As Integer
  1938. Declare Function IsWindowEnabled Lib "User" (ByVal hWnd As Integer) As Integer
  1939.  
  1940. Declare Function LoadAccelerators Lib "User" (ByVal hInstance As Integer, ByVal lpTableName As String) As Integer
  1941.  
  1942. Declare Function TranslateAccelerator Lib "User" (ByVal hWnd As Integer, ByVal hAccTable As Integer, lpMsg As MSG) As Integer
  1943.  
  1944.  
  1945. '  GetSystemMetrics() codes
  1946. Global Const SM_CXSCREEN = 0
  1947. Global Const SM_CYSCREEN = 1
  1948. Global Const SM_CXVSCROLL = 2
  1949. Global Const SM_CYHSCROLL = 3
  1950. Global Const SM_CYCAPTION = 4
  1951. Global Const SM_CXBORDER = 5
  1952. Global Const SM_CYBORDER = 6
  1953. Global Const SM_CXDLGFRAME = 7
  1954. Global Const SM_CYDLGFRAME = 8
  1955. Global Const SM_CYVTHUMB = 9
  1956. Global Const SM_CXHTHUMB = 10
  1957. Global Const SM_CXICON = 11
  1958. Global Const SM_CYICON = 12
  1959. Global Const SM_CXCURSOR = 13
  1960. Global Const SM_CYCURSOR = 14
  1961. Global Const SM_CYMENU = 15
  1962. Global Const SM_CXFULLSCREEN = 16
  1963. Global Const SM_CYFULLSCREEN = 17
  1964. Global Const SM_CYKANJIWINDOW = 18
  1965. Global Const SM_MOUSEPRESENT = 19
  1966. Global Const SM_CYVSCROLL = 20
  1967. Global Const SM_CXHSCROLL = 21
  1968. Global Const SM_DEBUG = 22
  1969. Global Const SM_SWAPBUTTON = 23
  1970. Global Const SM_RESERVED1 = 24
  1971. Global Const SM_RESERVED2 = 25
  1972. Global Const SM_RESERVED3 = 26
  1973. Global Const SM_RESERVED4 = 27
  1974. Global Const SM_CXMIN = 28
  1975. Global Const SM_CYMIN = 29
  1976. Global Const SM_CXSIZE = 30
  1977. Global Const SM_CYSIZE = 31
  1978. Global Const SM_CXFRAME = 32
  1979. Global Const SM_CYFRAME = 33
  1980. Global Const SM_CXMINTRACK = 34
  1981. Global Const SM_CYMINTRACK = 35
  1982. Global Const SM_CMETRICS = 36
  1983.  
  1984. Declare Function GetSystemMetrics Lib "User" (ByVal nIndex As Integer) As Integer
  1985.  
  1986. Declare Function LoadMenu Lib "User" (ByVal hInstance As Integer, ByVal lpString As String) As Integer
  1987. Declare Function LoadMenuIndirect Lib "User" (lpMenuTemplate As MENUITEMTEMPLATE) As Integer
  1988. Declare Function GetMenu Lib "User" (ByVal hWnd As Integer) As Integer
  1989. Declare Function SetMenu Lib "User" (ByVal hWnd As Integer, ByVal hMenu As Integer) As Integer
  1990. Declare Function ChangeMenu Lib "User" (ByVal hMenu As Integer, ByVal wID As Integer, ByVal lpszNew As String, ByVal wIDNew As Integer, ByVal wChange As Integer) As Integer
  1991. Declare Function HiliteMenuItem Lib "User" (ByVal hWnd As Integer, ByVal hMenu As Integer, ByVal wIDHiliteItem As Integer, ByVal wHilite As Integer) As Integer
  1992. Declare Function GetMenuString Lib "User" (ByVal hMenu As Integer, ByVal wIDItem As Integer, ByVal lpString As String, ByVal nMaxCount As Integer, ByVal wFlag As Integer) As Integer
  1993. Declare Function GetMenuState Lib "User" (ByVal hMenu As Integer, ByVal wId As Integer, ByVal wFlags As Integer) As Integer
  1994. Declare Sub DrawMenuBar Lib "User" (ByVal hWnd As Integer)
  1995. Declare Function GetSystemMenu Lib "User" (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer
  1996. Declare Function CreateMenu Lib "User" () As Integer
  1997. Declare Function CreatePopupMenu Lib "User" () As Integer
  1998. Declare Function DestroyMenu Lib "User" (ByVal hMenu As Integer) As Integer
  1999. Declare Function CheckMenuItem Lib "User" (ByVal hMenu As Integer, ByVal wIDCheckItem As Integer, ByVal wCheck As Integer) As Integer
  2000. Declare Function EnableMenuItem Lib "User" (ByVal hMenu As Integer, ByVal wIDEnableItem As Integer, ByVal wEnable As Integer) As Integer
  2001. Declare Function GetSubMenu Lib "User" (ByVal hMenu As Integer, ByVal nPos As Integer) As Integer
  2002. Declare Function GetMenuItemID Lib "User" (ByVal hMenu As Integer, ByVal nPos As Integer) As Integer
  2003. Declare Function GetMenuItemCount Lib "User" (ByVal hMenu As Integer) As Integer
  2004.  
  2005. Declare Function InsertMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpNewItem As Any) As Integer
  2006. Declare Function AppendMenu Lib "User" (ByVal hMenu As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpNewItem As Any) As Integer
  2007. Declare Function ModifyMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpString As Any) As Integer
  2008. Declare Function RemoveMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
  2009. Declare Function DeleteMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
  2010. Declare Function SetMenuItemBitmaps Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal hBitmapUnchecked As Integer, ByVal hBitmapChecked As Integer) As Integer
  2011. Declare Function GetMenuCheckMarkDimensions Lib "User" () As Long
  2012. Declare Function TrackPopupMenu Lib "User" (ByVal hMenu As Integer, ByVal wFlags As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nReserved As Integer, ByVal hWnd As Integer, lpReserved As Any) As Integer
  2013.  
  2014. Declare Sub UpdateWindow Lib "User" (ByVal hWnd As Integer)
  2015. Declare Function SetActiveWindow Lib "User" (ByVal hWnd As Integer) As Integer
  2016.  
  2017. Declare Function BeginPaint Lib "User" (ByVal hWnd As Integer, lpPaint As PAINTSTRUCT) As Integer
  2018. Declare Sub EndPaint Lib "User" (ByVal hWnd As Integer, lpPaint As PAINTSTRUCT)
  2019. Declare Function GetUpdateRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT, ByVal bErase As Integer) As Integer
  2020. Declare Function GetUpdateRgn Lib "User" (ByVal hWnd As Integer, ByVal hRgn As Integer, ByVal fErase As Integer) As Integer
  2021.  
  2022. Declare Function ExcludeUpdateRgn Lib "User" (ByVal hDC As Integer, ByVal hWnd As Integer) As Integer
  2023.  
  2024. Declare Sub InvalidateRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT, ByVal bErase As Integer)
  2025. Declare Sub ValidateRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT)
  2026.  
  2027. Declare Sub InvalidateRgn Lib "User" (ByVal hWnd As Integer, ByVal hRgn As Integer, ByVal bErase As Integer)
  2028. Declare Sub ValidateRgn Lib "User" (ByVal hWnd As Integer, ByVal hRgn As Integer)
  2029.  
  2030. Declare Sub ScrollWindow Lib "User" (ByVal hWnd As Integer, ByVal XAmount As Integer, ByVal YAmount As Integer, lpRect As RECT, lpClipRect As RECT)
  2031. Declare Function ScrollDC Lib "User" (ByVal hDC As Integer, ByVal dx As Integer, ByVal dy As Integer, lprcScroll As RECT, lprcClip As RECT, ByVal hRgnUpdate As Integer, lprcUpdate As RECT) As Integer
  2032.  
  2033. Declare Function SetScrollPos Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer, ByVal nPos As Integer, ByVal bRedraw As Integer) As Integer
  2034. Declare Function GetScrollPos Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer) As Integer
  2035. Declare Sub SetScrollRange Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer, ByVal nMinPos As Integer, ByVal nMaxPos As Integer, ByVal bRedraw As Integer)
  2036. Declare Sub GetScrollRange Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer, lpMinPos As Integer, lpMaxPos As Integer)
  2037. Declare Sub ShowScrollBar Lib "User" (ByVal hWnd As Integer, ByVal wBar As Integer, ByVal bShow As Integer)
  2038.  
  2039. Declare Function SetProp Lib "User" (ByVal hWnd As Integer, ByVal lpString As String, ByVal hData As Integer) As Integer
  2040. Declare Function GetProp Lib "User" (ByVal hWnd As Integer, ByVal lpString As Any) As Integer
  2041. Declare Function RemoveProp Lib "User" (ByVal hWnd As Integer, ByVal lpString As String) As Integer
  2042. Declare Sub SetWindowText Lib "User" (ByVal hWnd As Integer, ByVal lpString As String)
  2043. Declare Function GetWindowText Lib "User" (ByVal hWnd As Integer, ByVal lpString As String, ByVal aint As Integer) As Integer
  2044. Declare Function GetWindowTextLength Lib "User" (ByVal hWnd As Integer) As Integer
  2045.  
  2046. Declare Sub GetClientRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT)
  2047. Declare Sub GetWindowRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT)
  2048. Declare Sub AdjustWindowRect Lib "User" (lpRect As RECT, ByVal dwStyle As Long, ByVal bMenu As Integer)
  2049. Declare Sub AdjustWindowRectEx Lib "User" (lpRect As RECT, ByVal dsStyle As Long, ByVal bMenu As Integer, ByVal dwEsStyle As Long)
  2050.  
  2051.  
  2052. '  MessageBox() Flags
  2053. Global Const MB_OK = &H0
  2054. Global Const MB_OKCANCEL = &H1
  2055. Global Const MB_ABORTRETRYIGNORE = &H2
  2056. Global Const MB_YESNOCANCEL = &H3
  2057. Global Const MB_YESNO = &H4
  2058. Global Const MB_RETRYCANCEL = &H5
  2059.  
  2060. Global Const MB_ICONHAND = &H10
  2061. Global Const MB_ICONQUESTION = &H20
  2062. Global Const MB_ICONEXCLAMATION = &H30
  2063. Global Const MB_ICONASTERISK = &H40
  2064.  
  2065. Global Const MB_ICONINFORMATION = MB_ICONASTERISK
  2066. Global Const MB_ICONSTOP = MB_ICONHAND
  2067.  
  2068. Global Const MB_DEFBUTTON1 = &H0
  2069. Global Const MB_DEFBUTTON2 = &H100
  2070. Global Const MB_DEFBUTTON3 = &H200
  2071.  
  2072. Global Const MB_APPLMODAL = &H0
  2073. Global Const MB_SYSTEMMODAL = &H1000
  2074. Global Const MB_TASKMODAL = &H2000
  2075.  
  2076. Global Const MB_NOFOCUS = &H8000
  2077.  
  2078. Global Const MB_TYPEMASK = &HF
  2079. Global Const MB_ICONMASK = &HF0
  2080. Global Const MB_DEFMASK = &HF00
  2081. Global Const MB_MODEMASK = &H3000
  2082. Global Const MB_MISCMASK = &HC000
  2083.  
  2084. Declare Function MessageBox Lib "User" (ByVal hWnd As Integer, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Integer) As Integer
  2085. Declare Sub MessageBeep Lib "User" (ByVal wType As Integer)
  2086.  
  2087. Declare Function ShowCursor Lib "User" (ByVal bShow As Integer) As Integer
  2088. Declare Sub SetCursorPos Lib "User" (ByVal X As Integer, ByVal Y As Integer)
  2089. Declare Function SetCursor Lib "User" (ByVal hCursor As Integer) As Integer
  2090. Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI)
  2091. Declare Sub ClipCursor Lib "User" (lpRect As Any)
  2092.  
  2093. Declare Sub CreateCaret Lib "User" (ByVal hWnd As Integer, ByVal hBitmap As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer)
  2094. Declare Function GetCaretBlinkTime Lib "User" () As Integer
  2095. Declare Sub SetCaretBlinkTime Lib "User" (ByVal wMSeconds As Integer)
  2096. Declare Sub DestroyCaret Lib "User" ()
  2097. Declare Sub HideCaret Lib "User" (ByVal hWnd As Integer)
  2098. Declare Sub ShowCaret Lib "User" (ByVal hWnd As Integer)
  2099. Declare Sub SetCaretPos Lib "User" (ByVal X As Integer, ByVal Y As Integer)
  2100. Declare Sub GetCaretPos Lib "User" (lpPoint As POINTAPI)
  2101.  
  2102. Declare Sub ClientToScreen Lib "User" (ByVal hWnd As Integer, lpPoint As POINTAPI)
  2103. Declare Sub ScreenToClient Lib "User" (ByVal hWnd As Integer, lpPoint As POINTAPI)
  2104.  
  2105. Declare Function WindowFromPoint Lib "User" (ByVal Point As Any) As Integer
  2106. Declare Function ChildWindowFromPoint Lib "User" (ByVal hWnd As Integer, ByVal Point As Any) As Integer
  2107.  
  2108.  
  2109. '  Color Types
  2110. Global Const CTLCOLOR_MSGBOX = 0
  2111. Global Const CTLCOLOR_EDIT = 1
  2112. Global Const CTLCOLOR_LISTBOX = 2
  2113. Global Const CTLCOLOR_BTN = 3
  2114. Global Const CTLCOLOR_DLG = 4
  2115. Global Const CTLCOLOR_SCROLLBAR = 5
  2116. Global Const CTLCOLOR_STATIC = 6
  2117. Global Const CTLCOLOR_MAX = 8    '  three bits max
  2118.  
  2119. Global Const COLOR_SCROLLBAR = 0
  2120. Global Const COLOR_BACKGROUND = 1
  2121. Global Const COLOR_ACTIVECAPTION = 2
  2122. Global Const COLOR_INACTIVECAPTION = 3
  2123. Global Const COLOR_MENU = 4
  2124. Global Const COLOR_WINDOW = 5
  2125. Global Const COLOR_WINDOWFRAME = 6
  2126. Global Const COLOR_MENUTEXT = 7
  2127. Global Const COLOR_WINDOWTEXT = 8
  2128. Global Const COLOR_CAPTIONTEXT = 9
  2129. Global Const COLOR_ACTIVEBORDER = 10
  2130. Global Const COLOR_INACTIVEBORDER = 11
  2131. Global Const COLOR_APPWORKSPACE = 12
  2132. Global Const COLOR_HIGHLIGHT = 13
  2133. Global Const COLOR_HIGHLIGHTTEXT = 14
  2134. Global Const COLOR_BTNFACE = 15
  2135. Global Const COLOR_BTNSHADOW = 16
  2136. Global Const COLOR_GRAYTEXT = 17
  2137. Global Const COLOR_BTNTEXT = 18
  2138. Global Const COLOR_ENDCOLORS = COLOR_BTNTEXT
  2139.  
  2140. Declare Function GetSysColor Lib "User" (ByVal nIndex As Integer) As Long
  2141. Declare Sub SetSysColors Lib "User" (ByVal nChanges As Integer, lpSysColor As Integer, lpColorValues As Long)
  2142.  
  2143. Declare Function FillRgn Lib "User" (ByVal hDC As Integer, ByVal hRgn As Integer, ByVal hBrush As Integer) As Integer
  2144. Declare Function FrameRgn Lib "User" (ByVal hDC As Integer, ByVal hRgn As Integer, ByVal hBrush As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
  2145. Declare Function InvertRgn Lib "User" (ByVal hDC As Integer, ByVal hRgn As Integer) As Integer
  2146. Declare Function PaintRgn Lib "User" (ByVal hDC As Integer, ByVal hRgn As Integer) As Integer
  2147. Declare Function PtInRegion Lib "User" (ByVal hRgn As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  2148.  
  2149. Declare Sub DrawFocusRect Lib "User" (ByVal hDC As Integer, lpRect As RECT)
  2150. Declare Function FillRect Lib "User" (ByVal hDC As Integer, lpRect As RECT, ByVal hBrush As Integer) As Integer
  2151. Declare Function FrameRect Lib "User" (ByVal hDC As Integer, lpRect As RECT, ByVal hBrush As Integer) As Integer
  2152. Declare Sub InvertRect Lib "User" (ByVal hDC As Integer, lpRect As RECT)
  2153. Declare Sub SetRect Lib "User" (lpRect As RECT, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)
  2154. Declare Sub SetRectEmpty Lib "User" (lpRect As RECT)
  2155. Declare Function CopyRect Lib "User" (lpDestRect As RECT, lpSourceRect As RECT) As Integer
  2156. Declare Sub InflateRect Lib "User" (lpRect As RECT, ByVal X As Integer, ByVal Y As Integer)
  2157. Declare Function IntersectRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
  2158. Declare Function UnionRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
  2159. Declare Sub OffsetRect Lib "User" (lpRect As RECT, ByVal X As Integer, ByVal Y As Integer)
  2160. Declare Function IsRectEmpty Lib "User" (lpRect As RECT) As Integer
  2161. Declare Function EqualRect Lib "User" (lpRect1 As RECT, lpRect2 As RECT) As Integer
  2162. Declare Function PtInRect Lib "User" (lpRect As RECT, ByVal Point As Any) As Integer
  2163. Declare Function RectVisible Lib "User" (ByVal hDC As Integer, lpRect As RECT) As Integer
  2164. Declare Function RectInRegion Lib "User" (ByVal hRgn As Integer, lpRect As RECT) As Integer
  2165.  
  2166. Declare Function GetCurrentTime Lib "User" () As Long
  2167. Declare Function GetTickCount Lib "User" () As Long
  2168.  
  2169. Declare Function GetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
  2170. Declare Function SetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal wNewWord As Integer) As Integer
  2171. Declare Function GetWindowLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Long
  2172. Declare Function SetWindowLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
  2173. Declare Function GetClassWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
  2174. Declare Function SetClassWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal wNewWord As Integer) As Integer
  2175. Declare Function GetClassLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Long
  2176. Declare Function SetClassLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
  2177. Declare Function GetDesktopHwnd Lib "User" () As Integer
  2178. Declare Function GetDesktopWindow Lib "User" () As Integer
  2179.  
  2180.  
  2181. Declare Function GetParent Lib "User" (ByVal hWnd As Integer) As Integer
  2182. Declare Function SetParent Lib "User" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
  2183. Declare Function FindWindow Lib "User" (lpClassName As Any, lpWindowName As Any) As Integer
  2184. Declare Function GetClassName Lib "User" (ByVal hWnd As Integer, ByVal lpClassName As String, ByVal nMaxCount As Integer) As Integer
  2185. Declare Function GetTopWindow Lib "User" (ByVal hWnd As Integer) As Integer
  2186. Declare Function GetNextWindow Lib "User" (ByVal hWnd As Integer, ByVal wFlag As Integer) As Integer
  2187. Declare Function GetWindowTask Lib "User" (ByVal hWnd As Integer) As Integer
  2188. Declare Function GetLastActivePopup Lib "User" (ByVal hwndOwnder As Integer) As Integer
  2189.  
  2190. '  GetWindow() Constants
  2191. Global Const GW_HWNDFIRST = 0
  2192. Global Const GW_HWNDLAST = 1
  2193. Global Const GW_HWNDNEXT = 2
  2194. Global Const GW_HWNDPREV = 3
  2195. Global Const GW_OWNER = 4
  2196. Global Const GW_CHILD = 5
  2197.  
  2198. Declare Function GetWindow Lib "User" (ByVal hWnd As Integer, ByVal wCmd As Integer) As Integer
  2199.  
  2200. '  Menu flags for Add/Check/EnableMenuItem()
  2201. Global Const MF_INSERT = &H0
  2202. Global Const MF_CHANGE = &H80
  2203. Global Const MF_APPEND = &H100
  2204. Global Const MF_DELETE = &H200
  2205. Global Const MF_REMOVE = &H1000
  2206.  
  2207. Global Const MF_BYCOMMAND = &H0
  2208. Global Const MF_BYPOSITION = &H400
  2209.  
  2210. Global Const MF_SEPARATOR = &H800
  2211.  
  2212. Global Const MF_ENABLED = &H0
  2213. Global Const MF_GRAYED = &H1
  2214. Global Const MF_DISABLED = &H2
  2215.  
  2216. Global Const MF_UNCHECKED = &H0
  2217. Global Const MF_CHECKED = &H8
  2218. Global Const MF_USECHECKBITMAPS = &H200
  2219.  
  2220. Global Const MF_STRING = &H0
  2221. Global Const MF_BITMAP = &H4
  2222. Global Const MF_OWNERDRAW = &H100
  2223.  
  2224. Global Const MF_POPUP = &H10
  2225. Global Const MF_MENUBARBREAK = &H20
  2226. Global Const MF_MENUBREAK = &H40
  2227.  
  2228. Global Const MF_UNHILITE = &H0
  2229. Global Const MF_HILITE = &H80
  2230.  
  2231. Global Const MF_SYSMENU = &H2000
  2232. Global Const MF_HELP = &H4000
  2233. Global Const MF_MOUSESELECT = &H8000
  2234.  
  2235. '  Menu item resource format
  2236. Type MENUITEMTEMPLATEHEADER
  2237.     versionNumber As Integer
  2238.     offset As Integer
  2239. End Type
  2240.  
  2241. Type MENUITEMTEMPLATE
  2242.     mtOption As Integer
  2243.     mtID As Integer
  2244.     mtString As Long 
  2245. End Type
  2246.  
  2247. Global Const MF_END = &H80
  2248.  
  2249. '  System Menu Command Values
  2250. Global Const SC_SIZE = &HF000
  2251. Global Const SC_MOVE = &HF010
  2252. Global Const SC_MINIMIZE = &HF020
  2253. Global Const SC_MAXIMIZE = &HF030
  2254. Global Const SC_NEXTWINDOW = &HF040
  2255. Global Const SC_PREVWINDOW = &HF050
  2256. Global Const SC_CLOSE = &HF060
  2257. Global Const SC_VSCROLL = &HF070
  2258. Global Const SC_HSCROLL = &HF080
  2259. Global Const SC_MOUSEMENU = &HF090
  2260. Global Const SC_KEYMENU = &HF100
  2261. Global Const SC_ARRANGE = &HF110
  2262. Global Const SC_RESTORE = &HF120
  2263. Global Const SC_TASKLIST = &HF130
  2264.  
  2265. Global Const SC_ICON = SC_MINIMIZE
  2266. Global Const SC_ZOOM = SC_MAXIMIZE
  2267.  
  2268. '  Resource Loading Routines
  2269. Declare Function LoadBitmap Lib "User" (ByVal hInstance As Integer, ByVal lpBitmapName As Any) As Integer
  2270. Declare Function LoadCursor Lib "User" (ByVal hInstance As Integer, ByVal lpCursorName As Any) As Integer
  2271. Declare Function CreateCursor Lib "User" (ByVal hInstance%, ByVal nXhotspot%, ByVal nYhotspot%, ByVal nWidth%, ByVal nHeight%, ByVal lpANDbitPlane As Any, ByVal lpXORbitPlane As Any) As Integer
  2272. Declare Function DestroyCursor Lib "User" (ByVal hCursor As Integer) As Integer
  2273.  
  2274. '  Standard Cursor IDs
  2275. Global Const IDC_ARROW = 32512&
  2276. Global Const IDC_IBEAM = 32513&
  2277. Global Const IDC_WAIT = 32514&
  2278. Global Const IDC_CROSS = 32515&
  2279. Global Const IDC_UPARROW = 32516&
  2280. Global Const IDC_SIZE = 32640&
  2281. Global Const IDC_ICON = 32641&
  2282. Global Const IDC_SIZENWSE = 32642&
  2283. Global Const IDC_SIZENESW = 32643&
  2284. Global Const IDC_SIZEWE = 32644&
  2285. Global Const IDC_SIZENS = 32645&
  2286.  
  2287. Declare Function LoadIcon Lib "User" (ByVal hInstance As Integer, ByVal lpIconName As Any) As Integer
  2288. Declare Function CreateIcon Lib "User" (ByVal hInstance%, ByVal nWidth%, ByVal nHeight%, ByVal nPlanes%, ByVal nBitsPixel%, ByVal lpANDbits As Any, ByVal lpXORbits As Any) As Integer
  2289. Declare Function DestroyIcon Lib "User" (ByVal hIcon As Integer) As Integer
  2290.  
  2291.  
  2292. Global Const ORD_LANGDRIVER = 1    '  The ordinal number for the entry point of
  2293.                             '  language drivers.
  2294.  
  2295. '  Standard Icon IDs
  2296. Global Const IDI_APPLICATION = 32512&
  2297. Global Const IDI_HAND = 32513&
  2298. Global Const IDI_QUESTION = 32514&
  2299. Global Const IDI_EXCLAMATION = 32515&
  2300. Global Const IDI_ASTERISK = 32516&
  2301.  
  2302. Declare Function LoadString Lib "User" (ByVal hInstance As Integer, ByVal wID As Integer, ByVal lpBuffer As Any, ByVal nBufferMax As Integer) As Integer
  2303.  
  2304. Declare Function AddFontResource Lib "GDI" (ByVal lpFilename As Any) As Integer
  2305. Declare Function RemoveFontResource Lib "GDI" (ByVal lpFilename As Any) As Integer
  2306.  
  2307. '  Dialog Box Command IDs
  2308. Global Const IDOK = 1
  2309. Global Const IDCANCEL = 2
  2310. Global Const IDABORT = 3
  2311. Global Const IDRETRY = 4
  2312. Global Const IDIGNORE = 5
  2313. Global Const IDYES = 6
  2314. Global Const IDNO = 7
  2315.  
  2316.  
  2317. '  Control Manager Structures and Definitions
  2318.  
  2319. '  Edit Control Styles
  2320. Global Const ES_LEFT = &H0&
  2321. Global Const ES_CENTER = &H1&
  2322. Global Const ES_RIGHT = &H2&
  2323. Global Const ES_MULTILINE = &H4&
  2324. Global Const ES_UPPERCASE = &H8&
  2325. Global Const ES_LOWERCASE = &H10&
  2326. Global Const ES_PASSWORD = &H20&
  2327. Global Const ES_AUTOVSCROLL = &H40&
  2328. Global Const ES_AUTOHSCROLL = &H80&
  2329. Global Const ES_NOHIDESEL = &H100&
  2330. Global Const ES_OEMCONVERT = &H400&
  2331.  
  2332. '  Edit Control Notification Codes
  2333. Global Const EN_SETFOCUS = &H100
  2334. Global Const EN_KILLFOCUS = &H200
  2335. Global Const EN_CHANGE = &H300
  2336. Global Const EN_UPDATE = &H400
  2337. Global Const EN_ERRSPACE = &H500
  2338. Global Const EN_MAXTEXT = &H501
  2339. Global Const EN_HSCROLL = &H601
  2340. Global Const EN_VSCROLL = &H602
  2341.  
  2342. '  Edit Control Messages
  2343. Global Const EM_GETSEL = WM_USER+0
  2344. Global Const EM_SETSEL = WM_USER+1
  2345. Global Const EM_GETRECT = WM_USER+2
  2346. Global Const EM_SETRECT = WM_USER+3
  2347. Global Const EM_SETRECTNP = WM_USER+4
  2348. Global Const EM_SCROLL = WM_USER+5
  2349. Global Const EM_LINESCROLL = WM_USER+6
  2350. Global Const EM_GETMODIFY = WM_USER+7
  2351. Global Const EM_SETMODIFY = WM_USER+8
  2352. Global Const EM_GETLINECOUNT = WM_USER+9
  2353. Global Const EM_LINEINDEX = WM_USER+10
  2354. Global Const EM_SETHANDLE = WM_USER+12
  2355. Global Const EM_GETHANDLE = WM_USER+13
  2356. Global Const EM_GETTHUMB = WM_USER+14
  2357. Global Const EM_LINELENGTH = WM_USER+17
  2358. Global Const EM_REPLACESEL = WM_USER+18
  2359. Global Const EM_SETFONT = WM_USER+19
  2360. Global Const EM_GETLINE = WM_USER+20
  2361. Global Const EM_LIMITTEXT = WM_USER+21
  2362. Global Const EM_CANUNDO = WM_USER+22
  2363. Global Const EM_UNDO = WM_USER+23
  2364. Global Const EM_FMTLINES = WM_USER+24
  2365. Global Const EM_LINEFROMCHAR = WM_USER+25
  2366. Global Const EM_SETWORDBREAK = WM_USER+26
  2367. Global Const EM_SETTABSTOPS = WM_USER+27
  2368. Global Const EM_SETPASSWORDCHAR = WM_USER+28
  2369. Global Const EM_EMPTYUNDOBUFFER = WM_USER+29
  2370. Global Const EM_MSGMAX = WM_USER+30
  2371.  
  2372. '  Button Control Styles
  2373. Global Const BS_PUSHBUTTON = &H0&
  2374. Global Const BS_DEFPUSHBUTTON = &H1&
  2375. Global Const BS_CHECKBOX = &H2&
  2376. Global Const BS_AUTOCHECKBOX = &H3&
  2377. Global Const BS_RADIOBUTTON = &H4&
  2378. Global Const BS_3STATE = &H5&
  2379. Global Const BS_AUTO3STATE = &H6&
  2380. Global Const BS_GROUPBOX = &H7&
  2381. Global Const BS_USERBUTTON = &H8&
  2382. Global Const BS_AUTORADIOBUTTON = &H9&
  2383. Global Const BS_PUSHBOX = &HA&
  2384. Global Const BS_OWNERDRAW = &HB&
  2385. Global Const BS_LEFTTEXT = &H20&
  2386.  
  2387. '  User Button Notification Codes
  2388. Global Const BN_CLICKED = 0
  2389. Global Const BN_PAINT = 1
  2390. Global Const BN_HILITE = 2
  2391. Global Const BN_UNHILITE = 3
  2392. Global Const BN_DISABLE = 4
  2393. Global Const BN_DOUBLECLICKED = 5
  2394.  
  2395. '  Button Control Messages
  2396. Global Const BM_GETCHECK = WM_USER+0
  2397. Global Const BM_SETCHECK = WM_USER+1
  2398. Global Const BM_GETSTATE = WM_USER+2
  2399. Global Const BM_SETSTATE = WM_USER+3
  2400. Global Const BM_SETSTYLE = WM_USER+4
  2401.  
  2402. '  Static Control Constants
  2403. Global Const SS_LEFT = &H0&
  2404. Global Const SS_CENTER = &H1&
  2405. Global Const SS_RIGHT = &H2&
  2406. Global Const SS_ICON = &H3&
  2407. Global Const SS_BLACKRECT = &H4&
  2408. Global Const SS_GRAYRECT = &H5&
  2409. Global Const SS_WHITERECT = &H6&
  2410. Global Const SS_BLACKFRAME = &H7&
  2411. Global Const SS_GRAYFRAME = &H8&
  2412. Global Const SS_WHITEFRAME = &H9&
  2413. Global Const SS_USERITEM = &HA&
  2414. Global Const SS_SIMPLE = &HB&
  2415. Global Const SS_LEFTNOWORDWRAP = &HC&
  2416. Global Const SS_NOPREFIX = &H80&    '  Don't do "&" character translation
  2417.  
  2418. '  Dialog Manager Routines
  2419. Declare Function IsDialogMessage Lib "User" (ByVal hDlg As Integer, lpMsg As MSG) As Integer
  2420.  
  2421. Declare Sub MapDialogRect Lib "User" (ByVal hDlg As Integer, lpRect As RECT)
  2422.  
  2423. Declare Function DlgDirList Lib "User" (ByVal hDlg As Integer, ByVal lpPathSpec As String, ByVal nIDListBox As Integer, ByVal nIDStaticPath As Integer, ByVal wFiletype As Integer) As Integer
  2424. Declare Function DlgDirSelect Lib "User" (ByVal hDlg As Integer, ByVal lpString As String, ByVal nIDListBox As Integer) As Integer
  2425. Declare Function DlgDirListComboBox Lib "User" (ByVal hDlg As Integer, ByVal lpPathSpec As String, ByVal nIDComboBox As Integer, ByVal nIDStaticPath As Integer, ByVal wFileType As Integer) As Integer
  2426. Declare Function DlgDirSelectComboBox Lib "User" (ByVal hDlg As Integer, ByVal lpString As String, ByVal nIDComboBox As Integer) As Integer
  2427.  
  2428. '  Dialog Styles
  2429. Global Const DS_ABSALIGN = &H1&
  2430. Global Const DS_SYSMODAL = &H2&
  2431. Global Const DS_LOCALEDIT = &H20&    '  Edit items get Local storage.
  2432. Global Const DS_SETFONT = &H40&    '  User specified font for Dlg controls
  2433. Global Const DS_MODALFRAME = &H80&    '  Can be combined with WS_CAPTION
  2434. Global Const DS_NOIDLEMSG = &H100&    '  WM_ENTERIDLE message will not be sent
  2435.  
  2436. Global Const DM_GETDEFID = WM_USER+0
  2437. Global Const DM_SETDEFID = WM_USER+1
  2438. Global Const DC_HASDEFID = &H534%     '0x534B
  2439.  
  2440. '  Dialog Codes
  2441. Global Const DLGC_WANTARROWS = &H1    '  Control wants arrow keys
  2442. Global Const DLGC_WANTTAB = &H2    '  Control wants tab keys
  2443. Global Const DLGC_WANTALLKEYS = &H4    '  Control wants all keys
  2444. Global Const DLGC_WANTMESSAGE = &H4    '  Pass message to control
  2445. Global Const DLGC_HASSETSEL = &H8    '  Understands EM_SETSEL message
  2446. Global Const DLGC_DEFPUSHBUTTON = &H10    '  Default pushbutton
  2447. Global Const DLGC_UNDEFPUSHBUTTON = &H20    '  Non-default pushbutton
  2448. Global Const DLGC_RADIOBUTTON = &H40    '  Radio button
  2449. Global Const DLGC_WANTCHARS = &H80    '  Want WM_CHAR messages
  2450. Global Const DLGC_STATIC = &H100    '  Static item: don't include
  2451. Global Const DLGC_BUTTON = &H2000    '  Button item: can be checked
  2452.  
  2453. Global Const LB_CTLCODE = 0&
  2454.  
  2455. '  Listbox Return Values
  2456. Global Const LB_OKAY = 0
  2457. Global Const LB_ERR = (-1)
  2458. Global Const LB_ERRSPACE = (-2)
  2459.  
  2460. '
  2461. '  The idStaticPath parameter to DlgDirList can have the following values
  2462. '  ORed if the list box should show other details of the files along with
  2463. '  the name of the files;
  2464.  
  2465. '  all other details also will be returned
  2466.  
  2467. '  Listbox Notification Codes
  2468. Global Const LBN_ERRSPACE = (-2)
  2469. Global Const LBN_SELCHANGE = 1
  2470. Global Const LBN_DBLCLK = 2
  2471. Global Const LBN_SELCANCEL = 3
  2472. Global Const LBN_SETFOCUS = 4
  2473. Global Const LBN_KILLFOCUS = 5
  2474.  
  2475. '  Listbox messages
  2476. Global Const LB_ADDSTRING = (WM_USER+1)
  2477. Global Const LB_INSERTSTRING = (WM_USER+2)
  2478. Global Const LB_DELETESTRING = (WM_USER+3)
  2479. Global Const LB_RESETCONTENT = (WM_USER+5)
  2480. Global Const LB_SETSEL = (WM_USER+6)
  2481. Global Const LB_SETCURSEL = (WM_USER+7)
  2482. Global Const LB_GETSEL = (WM_USER+8)
  2483. Global Const LB_GETCURSEL = (WM_USER+9)
  2484. Global Const LB_GETTEXT = (WM_USER+10)
  2485. Global Const LB_GETTEXTLEN = (WM_USER+11)
  2486. Global Const LB_GETCOUNT = (WM_USER+12)
  2487. Global Const LB_SELECTSTRING = (WM_USER+13)
  2488. Global Const LB_DIR = (WM_USER+14)
  2489. Global Const LB_GETTOPINDEX = (WM_USER+15)
  2490. Global Const LB_FINDSTRING = (WM_USER+16)
  2491. Global Const LB_GETSELCOUNT = (WM_USER+17)
  2492. Global Const LB_GETSELITEMS = (WM_USER+18)
  2493. Global Const LB_SETTABSTOPS = (WM_USER+19)
  2494. Global Const LB_GETHORIZONTALEXTENT = (WM_USER+20)
  2495. Global Const LB_SETHORIZONTALEXTENT = (WM_USER+21)
  2496. Global Const LB_SETCOLUMNWIDTH = (WM_USER+22)
  2497. Global Const LB_SETTOPINDEX = (WM_USER+24)
  2498. Global Const LB_GETITEMRECT = (WM_USER+25)
  2499. Global Const LB_GETITEMDATA = (WM_USER+26)
  2500. Global Const LB_SETITEMDATA = (WM_USER+27)
  2501. Global Const LB_SELITEMRANGE = (WM_USER+28)
  2502. Global Const LB_MSGMAX = (WM_USER+33)
  2503.  
  2504. '  Listbox Styles
  2505. Global Const LBS_NOTIFY = &H1&
  2506. Global Const LBS_SORT = &H2&
  2507. Global Const LBS_NOREDRAW = &H4&
  2508. Global Const LBS_MULTIPLESEL = &H8&
  2509. Global Const LBS_OWNERDRAWFIXED = &H10&
  2510. Global Const LBS_OWNERDRAWVARIABLE = &H20&
  2511. Global Const LBS_HASSTRINGS = &H40&
  2512. Global Const LBS_USETABSTOPS = &H80&
  2513. Global Const LBS_NOINTEGRALHEIGHT = &H100&
  2514. Global Const LBS_MULTICOLUMN = &H200&
  2515. Global Const LBS_WANTKEYBOARDINPUT = &H400&
  2516. Global Const LBS_EXTENDEDSEL = &H800&
  2517. Global Const LBS_STANDARD = (LBS_NOTIFY Or LBS_SORT Or WS_VSCROLL Or WS_BORDER)
  2518.  
  2519. '  Combo Box return Values
  2520. Global Const CB_OKAY = 0
  2521. Global Const CB_ERR = (-1)
  2522. Global Const CB_ERRSPACE = (-2)
  2523.  
  2524. '  Combo Box Notification Codes
  2525. Global Const CBN_ERRSPACE = (-1)
  2526. Global Const CBN_SELCHANGE = 1
  2527. Global Const CBN_DBLCLK = 2
  2528. Global Const CBN_SETFOCUS = 3
  2529. Global Const CBN_KILLFOCUS = 4
  2530. Global Const CBN_EDITCHANGE = 5
  2531. Global Const CBN_EDITUPDATE = 6
  2532. Global Const CBN_DROPDOWN = 7
  2533.  
  2534. '  Combo Box styles
  2535. Global Const CBS_SIMPLE = &H1&
  2536. Global Const CBS_DROPDOWN = &H2&
  2537. Global Const CBS_DROPDOWNLIST = &H3&
  2538. Global Const CBS_OWNERDRAWFIXED = &H10&
  2539. Global Const CBS_OWNERDRAWVARIABLE = &H20&
  2540. Global Const CBS_AUTOHSCROLL = &H40&
  2541. Global Const CBS_OEMCONVERT = &H80&
  2542. Global Const CBS_SORT = &H100&
  2543. Global Const CBS_HASSTRINGS = &H200&
  2544. Global Const CBS_NOINTEGRALHEIGHT = &H400&
  2545.  
  2546. '  Combo Box messages
  2547. Global Const CB_GETEDITSEL = (WM_USER+0)
  2548. Global Const CB_LIMITTEXT = (WM_USER+1)
  2549. Global Const CB_SETEDITSEL = (WM_USER+2)
  2550. Global Const CB_ADDSTRING = (WM_USER+3)
  2551. Global Const CB_DELETESTRING = (WM_USER+4)
  2552. Global Const CB_DIR = (WM_USER+5)
  2553. Global Const CB_GETCOUNT = (WM_USER+6)
  2554. Global Const CB_GETCURSEL = (WM_USER+7)
  2555. Global Const CB_GETLBTEXT = (WM_USER+8)
  2556. Global Const CB_GETLBTEXTLEN = (WM_USER+9)
  2557. Global Const CB_INSERTSTRING = (WM_USER+10)
  2558. Global Const CB_RESETCONTENT = (WM_USER+11)
  2559. Global Const CB_FINDSTRING = (WM_USER+12)
  2560. Global Const CB_SELECTSTRING = (WM_USER+13)
  2561. Global Const CB_SETCURSEL = (WM_USER+14)
  2562. Global Const CB_SHOWDROPDOWN = (WM_USER+15)
  2563. Global Const CB_GETITEMDATA = (WM_USER+16)
  2564. Global Const CB_SETITEMDATA = (WM_USER+17)
  2565. Global Const CB_GETDROPPEDCONTROLRECT = (WM_USER+18)
  2566. Global Const CB_MSGMAX = (WM_USER+19)
  2567.  
  2568. '  Scroll Bar Styles
  2569. Global Const SBS_HORZ = &H0&
  2570. Global Const SBS_VERT = &H1&
  2571. Global Const SBS_TOPALIGN = &H2&
  2572. Global Const SBS_LEFTALIGN = &H2&
  2573. Global Const SBS_BOTTOMALIGN = &H4&
  2574. Global Const SBS_RIGHTALIGN = &H4&
  2575. Global Const SBS_SIZEBOXTOPLEFTALIGN = &H2&
  2576. Global Const SBS_SIZEBOXBOTTOMRIGHTALIGN = &H4&
  2577. Global Const SBS_SIZEBOX = &H8&
  2578.  
  2579.  
  2580. '  Sound Functions
  2581. '
  2582. Declare Function OpenSound Lib "Sound" () As Integer
  2583. Declare Sub CloseSound Lib "Sound" ()
  2584. Declare Function SetVoiceQueueSize Lib "Sound" (ByVal nVoice As Integer, ByVal nBytes As Integer) As Integer
  2585. Declare Function SetVoiceNote Lib "Sound" (ByVal nVoice As Integer, ByVal nValue As Integer, ByVal nLength As Integer, ByVal nCdots As Integer) As Integer
  2586. Declare Function SetVoiceAccent Lib "Sound" (ByVal nVoice As Integer, ByVal nTempo As Integer, ByVal nVolume As Integer, ByVal nMode As Integer, ByVal nPitch As Integer) As Integer
  2587. Declare Function SetVoiceEnvelope Lib "Sound" (ByVal nVoice As Integer, ByVal nShape As Integer, ByVal nRepeat As Integer) As Integer
  2588. Declare Function SetSoundNoise Lib "Sound" (ByVal nSource As Integer, ByVal nDuration As Integer) As Integer
  2589. Declare Function SetVoiceSound Lib "Sound" (ByVal nVoice As Integer, ByVal lFrequency As Long, ByVal nDuration As Integer) As Integer
  2590. Declare Function StartSound Lib "Sound" () As Integer
  2591. Declare Function StopSound Lib "Sound" () As Integer
  2592. Declare Function WaitSoundState Lib "Sound" (ByVal nState As Integer) As Integer
  2593. Declare Function SyncAllVoices Lib "Sound" () As Integer
  2594. Declare Function CountVoiceNotes Lib "Sound" (ByVal nVoice As Integer) As Integer
  2595. Declare Function GetThresholdEvent Lib "Sound" () As Integer
  2596. Declare Function GetThresholdStatus Lib "Sound" () As Integer
  2597. Declare Function SetVoiceThreshold Lib "Sound" (ByVal nVoice As Integer, ByVal nNotes As Integer) As Integer
  2598.  
  2599. '  WaitSoundState() Constants
  2600. Global Const S_QUEUEEMPTY = 0
  2601. Global Const S_THRESHOLD = 1
  2602. Global Const S_ALLTHRESHOLD = 2
  2603.  
  2604. '  Accent Modes
  2605. Global Const S_NORMAL = 0
  2606. Global Const S_LEGATO = 1
  2607. Global Const S_STACCATO = 2
  2608.  
  2609. '  SetSoundNoise() Sources
  2610. Global Const S_PERIOD512 = 0    '  Freq = N/512 high pitch, less coarse hiss
  2611. Global Const S_PERIOD1024 = 1    '  Freq = N/1024
  2612. Global Const S_PERIOD2048 = 2    '  Freq = N/2048 low pitch, more coarse hiss
  2613. Global Const S_PERIODVOICE = 3    '  Source is frequency from voice channel (3)
  2614. Global Const S_WHITE512 = 4    '  Freq = N/512 high pitch, less coarse hiss
  2615. Global Const S_WHITE1024 = 5    '  Freq = N/1024
  2616. Global Const S_WHITE2048 = 6    '  Freq = N/2048 low pitch, more coarse hiss
  2617. Global Const S_WHITEVOICE = 7    '  Source is frequency from voice channel (3)
  2618.  
  2619. Global Const S_SERDVNA = (-1)    '  Device not available
  2620. Global Const S_SEROFM = (-2)    '  Out of memory
  2621. Global Const S_SERMACT = (-3)    '  Music active
  2622. Global Const S_SERQFUL = (-4)    '  Queue full
  2623. Global Const S_SERBDNT = (-5)    '  Invalid note
  2624. Global Const S_SERDLN = (-6)    '  Invalid note length
  2625. Global Const S_SERDCC = (-7)    '  Invalid note count
  2626. Global Const S_SERDTP = (-8)    '  Invalid tempo
  2627. Global Const S_SERDVL = (-9)    '  Invalid volume
  2628. Global Const S_SERDMD = (-10)    '  Invalid mode
  2629. Global Const S_SERDSH = (-11)    '  Invalid shape
  2630. Global Const S_SERDPT = (-12)    '  Invalid pitch
  2631. Global Const S_SERDFQ = (-13)    '  Invalid frequency
  2632. Global Const S_SERDDR = (-14)    '  Invalid duration
  2633. Global Const S_SERDSR = (-15)    '  Invalid source
  2634. Global Const S_SERDST = (-16)    '  Invalid state
  2635.  
  2636. '  COMM declarations
  2637. '
  2638. Global Const NOPARITY = 0
  2639. Global Const ODDPARITY = 1
  2640. Global Const EVENPARITY = 2
  2641. Global Const MARKPARITY = 3
  2642. Global Const SPACEPARITY = 4
  2643.  
  2644. Global Const ONESTOPBIT = 0
  2645. Global Const ONE5STOPBITS = 1
  2646. Global Const TWOSTOPBITS = 2
  2647.  
  2648. Global Const IGNORE = 0    '  Ignore signal
  2649. Global Const INFINITE = &HFFFF    '  Infinite timeout
  2650.  
  2651. '  Error Flags
  2652. Global Const CE_RXOVER = &H1    '  Receive Queue overflow
  2653. Global Const CE_OVERRUN = &H2    '  Receive Overrun Error
  2654. Global Const CE_RXPARITY = &H4    '  Receive Parity Error
  2655. Global Const CE_FRAME = &H8    '  Receive Framing error
  2656. Global Const CE_BREAK = &H10    '  Break Detected
  2657. Global Const CE_CTSTO = &H20    '  CTS Timeout
  2658. Global Const CE_DSRTO = &H40    '  DSR Timeout
  2659. Global Const CE_RLSDTO = &H80    '  RLSD Timeout
  2660. Global Const CE_TXFULL = &H100    '  TX Queue is full
  2661. Global Const CE_PTO = &H200    '  LPTx Timeout
  2662. Global Const CE_IOE = &H400    '  LPTx I/O Error
  2663. Global Const CE_DNS = &H800    '  LPTx Device not selected
  2664. Global Const CE_OOP = &H1000    '  LPTx Out-Of-Paper
  2665. Global Const CE_MODE = &H8000    '  Requested mode unsupported
  2666.  
  2667. Global Const IE_BADID = (-1)    '  Invalid or unsupported id
  2668. Global Const IE_OPEN = (-2)    '  Device Already Open
  2669. Global Const IE_NOPEN = (-3)    '  Device Not Open
  2670. Global Const IE_MEMORY = (-4)    '  Unable to allocate queues
  2671. Global Const IE_DEFAULT = (-5)    '  Error in default parameters
  2672. Global Const IE_HARDWARE = (-10)    '  Hardware Not Present
  2673. Global Const IE_BYTESIZE = (-11)    '  Illegal Byte Size
  2674. Global Const IE_BAUDRATE = (-12)    '  Unsupported BaudRate
  2675.  
  2676. '  Events
  2677. Global Const EV_RXCHAR = &H1    '  Any Character received
  2678. Global Const EV_RXFLAG = &H2    '  Received certain character
  2679. Global Const EV_TXEMPTY = &H4    '  Transmitt Queue Empty
  2680. Global Const EV_CTS = &H8    '  CTS changed state
  2681. Global Const EV_DSR = &H10    '  DSR changed state
  2682. Global Const EV_RLSD = &H20    '  RLSD changed state
  2683. Global Const EV_BREAK = &H40    '  BREAK received
  2684. Global Const EV_ERR = &H80    '  Line status error occurred
  2685. Global Const EV_RING = &H100    '  Ring signal detected
  2686. Global Const EV_PERR = &H200    '  Printer error occured
  2687.  
  2688. '  Escape Functions
  2689. Global Const SETXOFF = 1    '  Simulate XOFF received
  2690. Global Const SETXON = 2    '  Simulate XON received
  2691. Global Const SETRTS = 3    '  Set RTS high
  2692. Global Const CLRRTS = 4    '  Set RTS low
  2693. Global Const SETDTR = 5    '  Set DTR high
  2694. Global Const CLRDTR = 6    '  Set DTR low
  2695. Global Const RESETDEV = 7    '  Reset device if possible
  2696.  
  2697. Global Const LPTx = &H80    '  Set if ID is for LPT device
  2698.  
  2699. Type DCB
  2700.     Id As String * 1
  2701.     BaudRate As Integer
  2702.     ByteSize As String * 1
  2703.     Parity As String * 1
  2704.     StopBits As String * 1
  2705.     RlsTimeout As Integer
  2706.     CtsTimeout As Integer
  2707.     DsrTimeout As Integer
  2708.  
  2709.     Bits1 As String * 1 ' The fifteen actual DCB bit-sized data fields
  2710.     Bits2 As String * 1 ' within these two bytes can be manipulated by
  2711.                           ' bitwise logical And/Or operations.  Refer to
  2712.                           ' SDKWIN.HLP for location/meaning of specific bits
  2713.  
  2714.     XonChar As String * 1
  2715.     XoffChar As String * 1
  2716.     XonLim As Integer
  2717.     XoffLim As Integer
  2718.     PeChar As String * 1
  2719.     EofChar As String * 1
  2720.     EvtChar As String * 1
  2721.     TxDelay As Integer
  2722. End Type
  2723.  
  2724. Type COMSTAT
  2725.     Bits As String * 1 ' For specific bit flags and their 
  2726.                          ' meanings, refer to SDKWIN.HLP.
  2727.     cbInQue As Integer
  2728.     cbOutQue As Integer
  2729. End Type
  2730.  
  2731. Declare Function OpenComm Lib "User" (ByVal lpComName As String, ByVal wInQueue As Integer, ByVal wOutQueue As Integer) As Integer
  2732. Declare Function SetCommState Lib "User" ()
  2733. Declare Function GetCommState Lib "User" (ByVal nCid As Integer, lpDCB as DCB) As Integer
  2734. Declare Function ReadComm Lib "User" (ByVal nCid As Integer, ByVal lpBuf As String, ByVal nSize As Integer) As Integer
  2735. Declare Function UngetCommChar Lib "User" (ByVal nCid As Integer, ByVal cChar As Integer) As Integer
  2736. Declare Function WriteComm Lib "User" (ByVal nCid As Integer, ByVal lpBuf As String, ByVal nSize As Integer) As Integer
  2737. Declare Function CloseComm Lib "User" (ByVal nCid As Integer) As Integer
  2738. Declare Function BuildCommDCB Lib "User" (ByVal lpDef As String, lpDCB As DCB) As Integer
  2739. Declare Function TransmitCommChar Lib "User" (ByVal nCid As Integer, ByVal cChar As Integer) As Integer
  2740. Declare Function SetCommEventMask Lib "User" (ByVal nCid as Integer, nEvtMask as Integer) As Long
  2741. Declare Function GetCommEventMask Lib "User" (ByVal nCid As Integer, ByVal nEvtMask As Integer) As Integer
  2742. Declare Function SetCommBreak Lib "User" (ByVal nCid As Integer) As Integer
  2743. Declare Function ClearCommBreak Lib "User" (ByVal nCid As Integer) As Integer
  2744. Declare Function FlushComm Lib "User" (ByVal nCid As Integer, ByVal nQueue As Integer) As Integer
  2745. Declare Function EscapeCommFunction Lib "User" (ByVal nCid As Integer, ByVal nFunc As Integer) As Integer
  2746.  
  2747. Type MDICREATESTRUCT
  2748.     szClass As Long
  2749.     szTitle As Long
  2750.     hOwner As Integer
  2751.     x As Integer
  2752.     y As Integer
  2753.     cx As Integer
  2754.     cy As Integer
  2755.     style As Long
  2756.     lParam As Long
  2757. End Type
  2758.  
  2759. Type CLIENTCREATESTRUCT
  2760.     hWindowMenu As Integer
  2761.     idFirstChild As Integer
  2762. End Type
  2763.  
  2764. Declare Function DefFrameProc Lib "User" (ByVal hWnd As Integer, ByVal hWndMDIClient As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Long) As Long
  2765. Declare Function DefMDIChildProc Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Long) As Long
  2766.  
  2767. Declare Function TranslateMDISysAccel Lib "User" (ByVal hWndClient As Integer, lpMsg As MSG) As Integer
  2768.  
  2769. Declare Function ArrangeIconicWindows Lib "User" (ByVal hWnd As Integer) As Integer
  2770.  
  2771.  
  2772. '   Help engine section.
  2773.  
  2774. '  Commands to pass WinHelp()
  2775. Global Const HELP_CONTEXT = &H1    '  Display topic in ulTopic
  2776. Global Const HELP_QUIT = &H2    '  Terminate help
  2777. Global Const HELP_INDEX = &H3    '  Display index
  2778. Global Const HELP_HELPONHELP = &H4    '  Display help on using help
  2779. Global Const HELP_SETINDEX = &H5    '  Set the current Index for multi index help
  2780. Global Const HELP_KEY = &H101        '  Display topic for keyword in offabData
  2781. Global Const HELP_MULTIKEY = &H201
  2782.  
  2783. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  2784.  
  2785. Type MULTIKEYHELP
  2786.     mkSize As Integer
  2787.     mkKeylist As String * 1
  2788.     szKeyphrase As String * 253 ' Array length is arbitrary; may be changed
  2789.  
  2790. End Type
  2791.  
  2792. '  function declarations for profiler routines contained in Windows libraries
  2793. Declare Function ProfInsChk Lib "User" () As Integer
  2794. Declare Sub ProfSetup Lib "User" (ByVal nBufferSize As Integer, ByVal nSamples As Integer)
  2795. Declare Sub ProfSampRate Lib "User" (ByVal nRate286 As Integer, ByVal nRate386 As Integer)
  2796. Declare Sub ProfStart Lib "User" ()
  2797. Declare Sub ProfStop Lib "User" ()
  2798. Declare Sub ProfClear Lib "User" ()
  2799. Declare Sub ProfFlush Lib "User" ()
  2800. Declare Sub ProfFinish Lib "User" ()
  2801.